2024-11-10 15:42:46 -05:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
|
|
frontend:
|
2024-12-07 14:58:15 -05:00
|
|
|
container_name: frontend
|
2024-11-10 15:42:46 -05:00
|
|
|
build:
|
|
|
|
|
context: ./client
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
ports:
|
|
|
|
|
- "5173:5173"
|
2024-11-11 15:46:02 -05:00
|
|
|
networks:
|
|
|
|
|
- quiz_network
|
2024-11-10 15:42:46 -05:00
|
|
|
restart: always
|
2024-12-07 14:58:15 -05:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "curl -f http://localhost:$${PORT} || exit 1"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
start_period: 5s
|
|
|
|
|
retries: 6
|
2024-12-06 21:01:23 -05:00
|
|
|
|
2024-11-10 15:42:46 -05:00
|
|
|
backend:
|
|
|
|
|
build:
|
|
|
|
|
context: ./server
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
container_name: backend
|
2024-12-07 14:58:15 -05:00
|
|
|
networks:
|
|
|
|
|
- quiz_network
|
2024-11-10 15:42:46 -05:00
|
|
|
ports:
|
|
|
|
|
- "3000:3000"
|
2024-11-10 23:41:03 -05:00
|
|
|
volumes:
|
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
2024-11-10 15:42:46 -05:00
|
|
|
environment:
|
|
|
|
|
PORT: 3000
|
|
|
|
|
MONGO_URI: "mongodb://mongo:27017/evaluetonsavoir"
|
|
|
|
|
MONGO_DATABASE: evaluetonsavoir
|
|
|
|
|
EMAIL_SERVICE: gmail
|
|
|
|
|
SENDER_EMAIL: infoevaluetonsavoir@gmail.com
|
|
|
|
|
EMAIL_PSW: 'vvml wmfr dkzb vjzb'
|
|
|
|
|
JWT_SECRET: haQdgd2jp09qb897GeBZyJetC8ECSpbFJe
|
2024-12-07 14:58:15 -05:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "curl -f http://localhost:$${PORT}/health || exit 1"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
start_period: 5s
|
|
|
|
|
retries: 6
|
2024-11-10 15:42:46 -05:00
|
|
|
|
2024-11-11 23:00:38 -05:00
|
|
|
quizroom: # Forces image to update
|
2024-11-10 15:42:46 -05:00
|
|
|
build:
|
|
|
|
|
context: ./quizRoom
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
container_name: quizroom
|
|
|
|
|
ports:
|
|
|
|
|
- "4500:4500"
|
2024-11-11 15:46:02 -05:00
|
|
|
networks:
|
|
|
|
|
- quiz_network
|
2024-11-10 15:42:46 -05:00
|
|
|
restart: always
|
2024-12-07 14:58:15 -05:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "/usr/src/app/healthcheck.sh"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
start_period: 5s
|
|
|
|
|
retries: 6
|
2024-11-10 15:42:46 -05:00
|
|
|
|
|
|
|
|
nginx:
|
|
|
|
|
build:
|
|
|
|
|
context: ./nginx
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
container_name: nginx
|
|
|
|
|
ports:
|
|
|
|
|
- "80:80"
|
|
|
|
|
depends_on:
|
2024-12-06 21:01:23 -05:00
|
|
|
frontend:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
backend:
|
|
|
|
|
condition: service_healthy
|
2024-11-11 15:46:02 -05:00
|
|
|
networks:
|
|
|
|
|
- quiz_network
|
2024-11-10 15:42:46 -05:00
|
|
|
restart: always
|
2024-12-06 18:19:23 -05:00
|
|
|
#environment:
|
|
|
|
|
# - PORT=8000
|
|
|
|
|
# - FRONTEND_HOST=frontend
|
|
|
|
|
# - FRONTEND_PORT=5173
|
|
|
|
|
# - BACKEND_HOST=backend
|
|
|
|
|
# - BACKEND_PORT=3000
|
2024-12-06 21:01:23 -05:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "wget --spider http://0.0.0.0:${PORT}/health || exit 1"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
start_period: 5s
|
|
|
|
|
retries: 6
|
2024-11-10 15:42:46 -05:00
|
|
|
|
|
|
|
|
mongo:
|
|
|
|
|
image: mongo
|
|
|
|
|
container_name: mongo
|
|
|
|
|
ports:
|
|
|
|
|
- "27017:27017"
|
|
|
|
|
tty: true
|
|
|
|
|
volumes:
|
|
|
|
|
- mongodb_data:/data/db
|
2024-11-11 15:46:02 -05:00
|
|
|
networks:
|
|
|
|
|
- quiz_network
|
2024-11-10 15:42:46 -05:00
|
|
|
restart: always
|
2024-12-06 21:01:23 -05:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
|
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 20s
|
2024-11-10 15:42:46 -05:00
|
|
|
|
|
|
|
|
watchtower:
|
|
|
|
|
image: containrrr/watchtower
|
|
|
|
|
container_name: watchtower
|
|
|
|
|
volumes:
|
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
|
environment:
|
|
|
|
|
- TZ=America/Montreal
|
|
|
|
|
- WATCHTOWER_CLEANUP=true
|
|
|
|
|
- WATCHTOWER_DEBUG=true
|
|
|
|
|
- WATCHTOWER_INCLUDE_RESTARTING=true
|
|
|
|
|
- WATCHTOWER_SCHEDULE=0 0 5 * * * # At 5 am everyday
|
2024-11-11 15:46:02 -05:00
|
|
|
networks:
|
|
|
|
|
- quiz_network
|
2024-11-10 15:42:46 -05:00
|
|
|
restart: always
|
|
|
|
|
|
2024-11-11 15:46:02 -05:00
|
|
|
networks:
|
|
|
|
|
quiz_network:
|
|
|
|
|
driver: bridge
|
|
|
|
|
|
2024-11-10 15:42:46 -05:00
|
|
|
volumes:
|
|
|
|
|
mongodb_data:
|
|
|
|
|
external: false
|