Files
THE-TIP-TOP/deploy/preprod/docker-compose.yml
Andil 2bbd2d16e4
Some checks failed
THE-TIP-TOP-MULTIBRANCH/pipeline/head There was a failure building this commit
ci: migrate deployments to VPS HTTPS infrastructure
2026-08-14 22:45:59 +00:00

88 lines
2.3 KiB
YAML

services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: tiptop_preprod
POSTGRES_PASSWORD: tiptop_preprod_password
POSTGRES_DB: the_tip_top_preprod
volumes:
- tiptop_preprod_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tiptop_preprod -d the_tip_top_preprod"]
interval: 10s
timeout: 5s
retries: 10
networks:
- tiptop-preprod
backend:
image: ${REGISTRY}/the-tip-top/backend:${IMAGE_TAG}
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
PORT: 5000
NODE_ENV: preproduction
DATABASE_URL: postgresql://tiptop_preprod:tiptop_preprod_password@postgres:5432/the_tip_top_preprod
JWT_SECRET: preprod_secret_change_me
APP_URL: https://api-preprod.dsp5-archi-o24a-4-5-g4.fr
command: >
sh -c "
npx prisma migrate deploy &&
npm run init:db &&
npm start
"
networks:
- tiptop-preprod
- proxy
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.tiptop-preprod-api.rule=Host(`api-preprod.dsp5-archi-o24a-4-5-g4.fr`)"
- "traefik.http.routers.tiptop-preprod-api.entrypoints=websecure"
- "traefik.http.routers.tiptop-preprod-api.tls=true"
- "traefik.http.routers.tiptop-preprod-api.tls.certresolver=letsencrypt"
- "traefik.http.services.tiptop-preprod-api.loadbalancer.server.port=5000"
frontend:
image: ${REGISTRY}/the-tip-top/frontend:${IMAGE_TAG}
restart: unless-stopped
depends_on:
- backend
networks:
- tiptop-preprod
- proxy
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.tiptop-preprod.rule=Host(`preprod.dsp5-archi-o24a-4-5-g4.fr`)"
- "traefik.http.routers.tiptop-preprod.entrypoints=websecure"
- "traefik.http.routers.tiptop-preprod.tls=true"
- "traefik.http.routers.tiptop-preprod.tls.certresolver=letsencrypt"
- "traefik.http.services.tiptop-preprod.loadbalancer.server.port=80"
volumes:
tiptop_preprod_postgres_data:
name: tiptop_preprod_postgres_data
networks:
tiptop-preprod:
name: tiptop-preprod
proxy:
external: true