- Separate admin login (ADMIN_USERNAME/ADMIN_PASSWORD) with its own JWT, no longer a seeded user account; lockout after 5 failed attempts - Admin panel tabs: Users, Notifications, Backups, Reset - Ntfy settings moved from .env/compose into admin_settings (token encrypted) - Scheduled and on-demand mariadb-dump backups to NFS volume, with restore (entries only or all) and retention pruning - Reset all entries, guarded by an automatic safety backup - Remove user impersonation and the admin link in the user nav - Login page falls back to admin login; nginx sends Cache-Control: no-cache Co-Authored-By: Claude Opus 5.5 <[email protected]>
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
services:
|
|
nginx:
|
|
image: nginx:alpine@sha256:0563c36f94a6d3ec3584161b77859f740f7e20b4853f52c796a864ce6908e8ea
|
|
ports:
|
|
- "8057:80"
|
|
volumes:
|
|
- ./frontend:/usr/share/nginx/html:ro
|
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
depends_on:
|
|
- backend
|
|
restart: unless-stopped
|
|
mem_limit: 128m
|
|
cpus: 0.25
|
|
|
|
backend:
|
|
build: ./backend
|
|
environment:
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
- SECRET_KEY=${SECRET_KEY}
|
|
- ACCESS_TOKEN_EXPIRE_MINUTES=${ACCESS_TOKEN_EXPIRE_MINUTES:-480}
|
|
- ADMIN_USERNAME=${ADMIN_USERNAME}
|
|
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
|
|
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-http://localhost}
|
|
volumes:
|
|
# Scheduled/manual backups (admin panel > Backups): the NFS-backed `backups`
|
|
# volume below, so they live off-host. The share must be writable by uid 1000.
|
|
- backups:/backups
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
mem_limit: 512m
|
|
cpus: 0.5
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
db:
|
|
image: mysql:8@sha256:a81d043930e51745522bd5c430961cf8286f0a23f0a9a2a6e0108f7ea71b0902
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
|
- MYSQL_USER=${MYSQL_USER}
|
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
|
volumes:
|
|
- mysql_data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
mem_limit: 512m
|
|
cpus: 0.5
|
|
|
|
volumes:
|
|
mysql_data:
|
|
# Off-host backups on the project's NFS share. Override the server/export
|
|
# with BACKUP_NFS_HOST / BACKUP_NFS_PATH in .env.
|
|
backups:
|
|
driver: local
|
|
driver_opts:
|
|
type: nfs
|
|
o: "addr=${BACKUP_NFS_HOST:-172.16.21.51},nfsvers=4.1,rw,hard,timeo=600,retrans=2"
|
|
device: ":${BACKUP_NFS_PATH:-/mnt/pool1/bourbonacci-backups}"
|