conf env de dev
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
FROM eclipse-temurin:25-jdk-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Pre-download dependencies (cached layer — rebuilt only if build.gradle changes)
|
||||||
|
COPY gradlew settings.gradle build.gradle ./
|
||||||
|
COPY gradle ./gradle
|
||||||
|
RUN chmod +x gradlew && ./gradlew dependencies --no-daemon -q
|
||||||
|
|
||||||
|
# Sources are mounted at runtime via docker-compose volume
|
||||||
|
ENTRYPOINT ["sh", "gradlew", "bootRun", "--no-daemon"]
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: bonsai
|
||||||
|
POSTGRES_USER: bonsai
|
||||||
|
POSTGRES_PASSWORD: bonsai
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U bonsai"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
api:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- ./src:/app/src:z # sources live depuis le host (SELinux :z)
|
||||||
|
- ./build.gradle:/app/build.gradle:z
|
||||||
|
- ./settings.gradle:/app/settings.gradle:z
|
||||||
|
- gradle_home:/root/.gradle # cache Gradle persistant (initialisé depuis l'image)
|
||||||
|
- gradle_build:/app/build # artefacts de build
|
||||||
|
environment:
|
||||||
|
DATASOURCE_URL: jdbc:postgresql://db:5432/bonsai
|
||||||
|
DATASOURCE_USERNAME: bonsai
|
||||||
|
DATASOURCE_PASSWORD: bonsai
|
||||||
|
KEYCLOAK_JWKS_URI: https://auth.goutailler-olivier.com/realms/bonsai/protocol/openid-connect/certs
|
||||||
|
CORS_ALLOWED_ORIGIN_PROD: https://bonsai.goutailler-olivier.com
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
gradle_home:
|
||||||
|
gradle_build:
|
||||||
@@ -20,6 +20,4 @@ spring:
|
|||||||
|
|
||||||
app:
|
app:
|
||||||
cors:
|
cors:
|
||||||
allowed-origins:
|
allowed-origins: "http://localhost:4200,${CORS_ALLOWED_ORIGIN_PROD:https://bonsai.goutailler-olivier.com}"
|
||||||
- http://localhost:4200
|
|
||||||
- ${CORS_ALLOWED_ORIGIN_PROD:https://bonsai.goutailler-olivier.com}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user