feat: production docker stack with nightly backups and README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8201496bb6
commit
a0bcea4eb1
7 files changed
+218
-2
No files matched your search
@@ -0,0 +1,48 @@
|
||||
# Stack de production : docker compose up -d --build
|
||||
services:
|
||||
db:
|
||||
image: mariadb:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MARIADB_DATABASE: finances
|
||||
MARIADB_USER: finances
|
||||
MARIADB_PASSWORD: ${MARIADB_PASSWORD:?à définir dans .env}
|
||||
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD:?à définir dans .env}
|
||||
TZ: Europe/Paris
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 20s
|
||||
|
||||
app:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: mysql://finances:${MARIADB_PASSWORD}@db:3306/finances
|
||||
SESSION_SECRET: ${SESSION_SECRET:?à définir dans .env (32 caractères minimum)}
|
||||
ports:
|
||||
- "${APP_PORT:-3000}:3000"
|
||||
|
||||
backup:
|
||||
image: mariadb:latest
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
entrypoint: ["bash", "/backup.sh"]
|
||||
environment:
|
||||
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
|
||||
TZ: Europe/Paris
|
||||
volumes:
|
||||
- ./docker/backup.sh:/backup.sh:ro
|
||||
- ./backups:/backups
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
Reference in new issue
Block a user