- Included a volume mapping for the `./backups` directory in the docker-compose file to facilitate backup management.
54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
towercontrol:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "3006:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- DATABASE_URL=file:/app/data/prod.db
|
|
- TZ=Europe/Paris
|
|
volumes:
|
|
# Volume persistant pour la base SQLite
|
|
- sqlite_data:/app/data
|
|
# Monter ta DB locale (décommente pour utiliser tes données locales)
|
|
- ./prisma/dev.db:/app/data/prod.db
|
|
- ./backups:/app/backups
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# Service de développement (optionnel)
|
|
towercontrol-dev:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: base
|
|
ports:
|
|
- "3005:3000"
|
|
environment:
|
|
- NODE_ENV=development
|
|
- DATABASE_URL=file:/app/data/dev.db
|
|
volumes:
|
|
- .:/app
|
|
- /app/node_modules
|
|
- /app/.next
|
|
- sqlite_data_dev:/app/data
|
|
command: sh -c "npm install && npx prisma generate && npx prisma migrate deploy && npm run dev"
|
|
profiles:
|
|
- dev
|
|
|
|
volumes:
|
|
sqlite_data:
|
|
driver: local
|
|
sqlite_data_dev:
|
|
driver: local
|
|
|