mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2025-12-15 21:56:50 +01:00
90 lines
2.0 KiB
YAML
90 lines
2.0 KiB
YAML
services:
|
|
nginx:
|
|
image: nginx:latest
|
|
container_name: nginx
|
|
ports:
|
|
- "1080:80"
|
|
- "1443:443"
|
|
volumes:
|
|
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
- ./certs/ssl:/etc/nginx/ssl
|
|
networks:
|
|
- app-network
|
|
depends_on:
|
|
- backend
|
|
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: backend
|
|
container_name: backend
|
|
restart: always
|
|
command: /bin/sh -c "sleep 5 &&
|
|
venv/bin/python manage.py makemigrations --noinput &&
|
|
venv/bin/python manage.py migrate --noinput &&
|
|
venv/bin/python manage.py collectstatic --noinput &&
|
|
venv/bin/daphne -b 0.0.0.0 -p 8080 pong.asgi:application"
|
|
volumes:
|
|
- pong:/transcendence/pong
|
|
- pong_django_logs:/transcendence/logs
|
|
ports:
|
|
- 8080:8080
|
|
networks:
|
|
- app-network
|
|
environment:
|
|
DB_HOST: db
|
|
DB_PORT: 5432
|
|
DB_NAME: ${POSTGRES_DB}
|
|
DB_USER: ${POSTGRES_USER}
|
|
DB_PASSWORD: ${POSTGRES_PASSWORD}
|
|
PRIVATE_KEY: ${PRIVATE_KEY}
|
|
WEB3_PROVIDER: ${WEB3_PROVIDER}
|
|
CONTRACT_ADDRESS: ${CONTRACT_ADDRESS}
|
|
WEB3_ACCOUNT: ${WEB3_ACCOUNT}
|
|
depends_on:
|
|
- db
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl", "http://localhost:8080"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
db:
|
|
image: postgres:latest
|
|
container_name: postgres
|
|
restart: always
|
|
volumes:
|
|
- pong_pg_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
networks:
|
|
- app-network
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
pong:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
device: ${PROJECT_PATH}
|
|
o: bind
|
|
pong_django_logs:
|
|
name: shared_pong_django_logs
|
|
pong_pg_data:
|
|
|
|
|
|
networks:
|
|
app-network:
|
|
name: app-network
|
|
driver: bridge
|