75 lines
1.7 KiB
YAML
75 lines
1.7 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: fradelg/mysql-cron-backup
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: on-failure
|
|
environment:
|
|
MYSQL_HOST: db
|
|
MYSQL_USER: root
|
|
MYSQL_PASS: ${DB_PASSWORD:-root_password}
|
|
CRON_TIME: "55 2 * * *" # Roda todo dia exatamente às 02:55 da manhã
|
|
MAX_BACKUPS: 3 # Mantém apenas os 3 últimos dias
|
|
INIT_BACKUP: "1" # Faz um backup imediatamente ao ligar o container
|
|
volumes:
|
|
- /opt/backups_db/fastob:/backup
|
|
networks:
|
|
- fasto-net
|
|
|
|
volumes:
|
|
db_data:
|
|
|
|
configs:
|
|
init_sql:
|
|
file: ./agenciac_comia.sql
|
|
name: init_sql_v2
|
|
|
|
networks:
|
|
fasto-net:
|
|
driver: overlay
|