Files
THE-TIP-TOP/deploy/preprod/docker-compose.yml
Emma781227 8adf780da2 Variables de connexion externe dans les environnements Docker
Ajoute FRONTEND_URL, absent des trois environnements alors que le callback
OAuth et la liste d'origines CORS en dépendent : sans lui le backend
retombait sur localhost:5173 et refusait le front déployé.

Les identifiants Google et Facebook passent par substitution depuis
l'environnement du pipeline, afin de ne pas committer de secret.

Ignore aussi test-results/, généré par le reporter jest-junit ajouté par la
chaîne CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 00:25:54 +02:00

88 lines
2.0 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: http://192.168.1.23:5002
FRONTEND_URL: http://192.168.1.23:5174
MAIL_HOST: smtp.gmail.com
MAIL_PORT: 587
MAIL_USER: ""
MAIL_PASS: ""
MAIL_FROM: "The Tip Top Preprod <no-reply@tiptop.local>"
# Injectés par le pipeline, jamais commités. Vides, les routes de
# connexion externe répondent 503 sans bloquer le démarrage.
GOOGLE_CLIENT_ID: "${GOOGLE_CLIENT_ID:-}"
GOOGLE_CLIENT_SECRET: "${GOOGLE_CLIENT_SECRET:-}"
FACEBOOK_APP_ID: "${FACEBOOK_APP_ID:-}"
FACEBOOK_APP_SECRET: "${FACEBOOK_APP_SECRET:-}"
command: >
sh -c "
npx prisma migrate deploy &&
npm run init:db &&
npm start
"
ports:
- "5002:5000"
networks:
- tiptop-preprod
frontend:
image: ${REGISTRY}/the-tip-top/frontend:${IMAGE_TAG}
restart: unless-stopped
depends_on:
- backend
ports:
- "5174:80"
networks:
- tiptop-preprod
volumes:
tiptop_preprod_postgres_data:
name: tiptop_preprod_postgres_data
networks:
tiptop-preprod:
name: tiptop-preprod