- Updated `.gitignore` to only exclude `.db` files in the `/data/` directory and preserve backups. - Modified `docker-compose.yml` to switch database and backup paths to `dev.db`, aligning with the current development setup.
58 lines
1.8 KiB
YAML
58 lines
1.8 KiB
YAML
services:
|
|
towercontrol:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: runner
|
|
ports:
|
|
- "3006:3000"
|
|
environment:
|
|
NODE_ENV: production
|
|
DATABASE_URL: "file:../data/dev.db" # Prisma
|
|
BACKUP_DATABASE_PATH: "./data/dev.db" # Base de données à sauvegarder
|
|
BACKUP_STORAGE_PATH: "./data/backups" # Dossier des sauvegardes
|
|
TZ: Europe/Paris
|
|
volumes:
|
|
- ./data:/app/data # Dossier local data/ vers /app/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
towercontrol-dev:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: base
|
|
ports:
|
|
- "3005:3000"
|
|
environment:
|
|
NODE_ENV: development
|
|
DATABASE_URL: "file:../data/dev.db" # Prisma
|
|
BACKUP_DATABASE_PATH: "./data/dev.db" # Base de données à sauvegarder
|
|
BACKUP_STORAGE_PATH: "./data/backups" # Dossier des sauvegardes
|
|
TZ: Europe/Paris
|
|
volumes:
|
|
- .:/app # code en live
|
|
- /app/node_modules # vol anonyme pour ne pas écraser ceux du conteneur
|
|
- /app/.next
|
|
- ./data:/app/data # Dossier local data/ vers /app/data
|
|
command: >
|
|
sh -c "npm install &&
|
|
npx prisma generate &&
|
|
npx prisma migrate deploy &&
|
|
npm run dev"
|
|
profiles:
|
|
- dev
|
|
|
|
# 📁 Structure des données :
|
|
# ./data/ -> /app/data (bind mount)
|
|
# ├── prod.db -> Base de données production
|
|
# ├── dev.db -> Base de données développement
|
|
# └── backups/ -> Sauvegardes automatiques
|
|
#
|
|
# 🔧 Configuration via .env.docker
|
|
# 📚 Documentation : ./data/README.md |