From 3b4ef37e58a83320791ed8def684c3beb8f637a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=20K=C3=BCng?= Date: Mon, 9 Feb 2026 19:29:14 +0100 Subject: [PATCH] feat(web): * for reaquired field --- backend/build.gradle | 2 ++ .../src/main/resources/application.properties | 8 ++++++++ docker-compose.deploy.yml | 4 ++-- docker-compose.yml | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index 82927d9..35b1154 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -24,6 +24,8 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + runtimeOnly 'org.postgresql:postgresql' developmentOnly 'org.springframework.boot:spring-boot-devtools' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index f9efc6e..49c9036 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,6 +1,14 @@ spring.application.name=backend server.port=8000 +# Database Configuration +spring.datasource.url=${DB_URL:jdbc:postgresql://localhost:5432/printcalc} +spring.datasource.username=${DB_USERNAME:printcalc} +spring.datasource.password=${DB_PASSWORD:printcalc_secret} +spring.jpa.hibernate.ddl-auto=update +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect + + # Slicer Configuration # Map SLICER_PATH env var if present (default to /opt/orcaslicer/AppRun or Mac path) slicer.path=${SLICER_PATH:/Applications/OrcaSlicer.app/Contents/MacOS/OrcaSlicer} diff --git a/docker-compose.deploy.yml b/docker-compose.deploy.yml index 14cdd1a..94bdfb2 100644 --- a/docker-compose.deploy.yml +++ b/docker-compose.deploy.yml @@ -15,7 +15,7 @@ services: - MARKUP_PERCENT=${MARKUP_PERCENT} - TEMP_DIR=/app/temp - PROFILES_DIR=/app/profiles - restart: unless-stopped + restart: always volumes: - backend_profiles_${ENV}:/app/profiles @@ -26,7 +26,7 @@ services: - "${FRONTEND_PORT}:8008" depends_on: - backend - restart: unless-stopped + restart: always volumes: backend_profiles_prod: diff --git a/docker-compose.yml b/docker-compose.yml index b62f814..7009b84 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,4 +25,21 @@ services: - "80:80" depends_on: - backend + - db restart: unless-stopped + + db: + image: postgres:15-alpine + container_name: print-calculator-db + environment: + - POSTGRES_USER=printcalc + - POSTGRES_PASSWORD=printcalc_secret + - POSTGRES_DB=printcalc + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + restart: unless-stopped + +volumes: + postgres_data: