Files
wagfarm/compose.yaml
2025-04-17 15:22:55 +02:00

50 lines
1.1 KiB
YAML

services:
db:
image: postgres:16
container_name: wagfarm-db
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- wagfarm-net
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-U", "${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
api:
build: ./wagfarm-api
container_name: wagfarm-api
restart: always
environment:
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_DATABASE}
- GIN_MODE=${GIN_MODE}
ports:
- "8089:8080"
depends_on:
db:
condition: service_healthy
networks:
- wagfarm-net
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] # or use the health endpoint of your API
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
wagfarm-net:
volumes:
pgdata: