42 lines
960 B
YAML
42 lines
960 B
YAML
services:
|
|
backend:
|
|
build: ./backend
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "/usr/bin/curl", "-f", "http://localhost:8080/api/service/health"]
|
|
interval: 5s
|
|
timeout: 10s
|
|
retries: 3
|
|
ports:
|
|
- "8080:8080"
|
|
networks:
|
|
- app-network
|
|
|
|
postgres:
|
|
image: postgres:latest
|
|
healthcheck:
|
|
test: [ "CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}" ]
|
|
interval: 5s
|
|
timeout: 10s
|
|
retries: 3
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
ports:
|
|
- "5432:5432"
|
|
networks:
|
|
- app-network
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./sqlc/schema.sql:/docker-entrypoint-initdb.d/init.sql
|
|
|
|
volumes:
|
|
postgres-data:
|
|
networks:
|
|
app-network:
|
|
driver: bridge
|