Files
fasto/docker-compose.yml
Cauê Faleiros 9ffcfcdcc8
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m56s
chore: add automated database backup service and tighten backend security
- Added `databack/mysql-backup` service to the production docker-compose Swarm stack, scheduling a daily 02:55 AM cron backup of the database with a 3-day local retention policy.

- Fixed a critical race condition in the backend JWT authentication middleware where an invalid token returning 401 could crash the response flow if the route executed before the defensive checks caught it.

- Added strict undefined defensive checks to the `getUserById` endpoint and RBAC middleware to gracefully reject requests that somehow bypass the token parser.

- Updated `GEMINI.md` technical documentation to fully match the real codebase logic.

- Fixed UX rule to prevent `manager` role from seeing Funnels or Origins tabs in the sidebar.

- Blocked `agent` role from modifying their own 'fullName' string in the Profile UI.
2026-03-25 12:40:53 -03:00

73 lines
1.6 KiB
YAML

version: "3.8"
services:
app:
image: gitea.blyzer.com.br/blyzer/fasto:latest
environment:
- NODE_ENV=production
- PORT=3001
- DB_HOST=db
- DB_USER=${DB_USER:-root}
- DB_PASSWORD=${DB_PASSWORD:-root_password}
- DB_NAME=${DB_NAME:-agenciac_comia}
- SMTP_HOST=${SMTP_HOST}
- SMTP_PORT=${SMTP_PORT}
- SMTP_USER=${SMTP_USER}
- SMTP_PASS=${SMTP_PASS}
- MAIL_FROM=${MAIL_FROM}
- APP_URL=${APP_URL}
- JWT_SECRET=${JWT_SECRET}
ports:
- "3001:3001"
deploy:
replicas: 1
restart_policy:
condition: on-failure
networks:
- fasto-net
db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-root_password}
MYSQL_DATABASE: ${DB_NAME:-agenciac_comia}
volumes:
- db_data:/var/lib/mysql
configs:
- source: init_sql
target: /docker-entrypoint-initdb.d/init.sql
deploy:
replicas: 1
restart_policy:
condition: on-failure
networks:
- fasto-net
backup-mysql:
image: databack/mysql-backup
environment:
DB_SERVER: db
DB_USER: root
DB_PASS: ${DB_PASSWORD:-root_password}
DB_DUMP_CRON: "55 2 * * *" # Roda todo dia exatamente às 02:55 da manhã
DB_CLEANUP_TIME: 4320 # Apaga os locais mais velhos que 3 dias
volumes:
- /root/backups_db:/db
networks:
- fasto-net
deploy:
placement:
constraints:
- node.role == manager
volumes:
db_data:
configs:
init_sql:
file: ./agenciac_comia.sql
networks:
fasto-net:
driver: overlay