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: - "34013:8080" depends_on: db: condition: service_healthy networks: - wagfarm-net healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/health"] interval: 30s timeout: 10s retries: 3 start_period: 5s ui: build: ./wagfarm-ui container_name: wagfarm-ui restart: always ports: - "34014:80" depends_on: api: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:80"] interval: 30s timeout: 10s retries: 3 start_period: 5s networks: wagfarm-net: volumes: pgdata: