compose.yml
1,632 bytes
| 1 | services: |
|---|---|
| 2 | db: |
| 3 | image: postgres:17-alpine |
| 4 | environment: |
| 5 | POSTGRES_DB: ${POSTGRES_DB:-tasteprint} |
| 6 | POSTGRES_USER: ${POSTGRES_USER:-tasteprint} |
| 7 | POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-tasteprint-local} |
| 8 | volumes: |
| 9 | - postgres_data:/var/lib/postgresql/data |
| 10 | healthcheck: |
| 11 | test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] |
| 12 | interval: 5s |
| 13 | timeout: 3s |
| 14 | retries: 10 |
| 15 | restart: unless-stopped |
| 16 | |
| 17 | backend: |
| 18 | build: ./backend |
| 19 | environment: |
| 20 | DB_URL: jdbc:postgresql://db:5432/${POSTGRES_DB:-tasteprint} |
| 21 | DB_USER: ${POSTGRES_USER:-tasteprint} |
| 22 | DB_PASSWORD: ${POSTGRES_PASSWORD:-tasteprint-local} |
| 23 | APP_ALLOWED_ORIGINS: ${APP_ALLOWED_ORIGINS:-http://localhost:3000} |
| 24 | DEMO_DATA_ENABLED: ${DEMO_DATA_ENABLED:-true} |
| 25 | MEDIA_DIRECTORY: /app/uploads |
| 26 | SERVER_SHUTDOWN: graceful |
| 27 | SPRING_LIFECYCLE_TIMEOUT_PER_SHUTDOWN_PHASE: 20s |
| 28 | volumes: |
| 29 | - uploaded_media:/app/uploads |
| 30 | ports: |
| 31 | - "127.0.0.1:8080:8080" |
| 32 | depends_on: |
| 33 | db: |
| 34 | condition: service_healthy |
| 35 | healthcheck: |
| 36 | test: ["CMD", "wget", "-qO-", "http://localhost:8080/actuator/health/readiness"] |
| 37 | interval: 10s |
| 38 | timeout: 4s |
| 39 | retries: 12 |
| 40 | start_period: 20s |
| 41 | restart: unless-stopped |
| 42 | |
| 43 | frontend: |
| 44 | build: ./frontend |
| 45 | ports: |
| 46 | - "3000:80" |
| 47 | depends_on: |
| 48 | backend: |
| 49 | condition: service_healthy |
| 50 | healthcheck: |
| 51 | test: ["CMD", "wget", "-qO-", "http://127.0.0.1/healthz"] |
| 52 | interval: 10s |
| 53 | timeout: 3s |
| 54 | retries: 5 |
| 55 | restart: unless-stopped |
| 56 | |
| 57 | volumes: |
| 58 | postgres_data: |
| 59 | uploaded_media: |
| 60 | |