Files
projet_gestion_commande/backend/gestion/docker-compose.yml
T
2026-01-21 16:26:15 +01:00

52 lines
1.2 KiB
YAML

services:
postgres:
image: postgres:16
container_name: gestion_postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "${DB_PORT}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- gestion-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7
container_name: gestion_redis
restart: unless-stopped
command:
[
"redis-server",
"--appendonly",
"yes",
"--requirepass",
"${REDIS_PASSWORD}",
]
ports:
- "${REDIS_PORT}:6379"
volumes:
- redis_data:/data
networks:
- gestion-net
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
gestion-net:
volumes:
postgres_data:
redis_data: