45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
services:
|
|
app:
|
|
build: .
|
|
restart: unless-stopped
|
|
environment:
|
|
DATABASE_URL: postgresql://fpt:${POSTGRES_PASSWORD:-fpt_secret}@db:5432/fpt?schema=public
|
|
NODE_ENV: production
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
networks:
|
|
- traefik
|
|
- internal
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.fpt.rule=Host(`fpt.aicds.ch`)"
|
|
- "traefik.http.routers.fpt.entrypoints=websecure"
|
|
- "traefik.http.routers.fpt.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.fpt.loadbalancer.server.port=3000"
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: fpt
|
|
POSTGRES_USER: fpt
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-fpt_secret}
|
|
volumes:
|
|
- fpt_pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U fpt -d fpt"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
networks:
|
|
- internal
|
|
|
|
volumes:
|
|
fpt_pgdata:
|
|
|
|
networks:
|
|
traefik:
|
|
external: true
|
|
internal:
|