ScoDoc/docker-compose.yml
Lyanis Souidi 777fee9379
Modification docker
- Utilisation de la dernière version de l'image postgres
- Supression du cache pip après le build pour alléger l'image
- Modification de la gestion de la variable d'environnement FLASK_ENV :
  - Comportement par défaut = production
  - Si la variable d'environnement FLASK_ENV est définie dans le docker-compose.yml, alors on utilise sa valeur
2024-06-07 15:08:15 +02:00

66 lines
1.5 KiB
YAML

services:
scodoc:
image: scodoc/scodoc
container_name: scodoc
restart: unless-stopped
environment:
SCODOC_DATABASE_URI: postgresql://scodb:scodb@db/SCODOC
CACHE_REDIS_HOST: cache
SCODOC_ADMIN_MAIL: admin@scodoc.local
SCODOC_ADMIN_PASSWORD: p@ssword
#SCODOC_MAIL_FROM: no-reply@scodoc.local
#MAIL_SERVER: smtp.scodoc.local
#MAIL_PORT: 587
#MAIL_USE_TLS: True
#MAIL_USERNAME: scodoc
#MAIL_PASSWORD: scodoc
ports:
- "127.0.0.1:8000:8000"
volumes:
- scodata:/opt/scodoc-data
depends_on:
db:
condition: service_started
cache:
condition: service_healthy
networks:
- db
- cache
db:
image: postgres
container_name: scodoc_db
restart: unless-stopped
environment:
POSTGRES_USER: scodb
POSTGRES_PASSWORD: scodb
volumes:
- scodb:/var/lib/postgresql/data
networks:
- db
cache:
image: valkey/valkey
container_name: scodoc_cache
restart: unless-stopped
networks:
- cache
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
watchtower:
image: containrrr/watchtower
container_name: watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro
command: scodoc scodoc_db scodoc_cache --schedule "0 0 2 * * *"
volumes:
scodata:
scodb:
networks:
db:
cache: