Files
gate-watch/docker-compose.yml
Alexandre Possebom f1786c6af8 chore!: rebrand to gate-watch
Package/lib/binary renamed (gate_watch crate), SPA branding + storage keys,
docker-compose services/db renamed, Dockerfile drops the lpr-whitelist git
credential. CI keeps build+push (image name follows the repo) and the Telegram
notify, but the prefecture deploy webhook is gone. Prefecture-specific deploy/
configs and historical docs/ removed (git history keeps them).
2026-08-06 10:42:54 -03:00

113 lines
2.8 KiB
YAML

services:
gate-watch:
image: git.possebom.com/alexandre/gate-watch:latest
container_name: gate-watch
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./images:/app/images
depends_on:
db:
condition: service_healthy
environment:
- TZ=America/Sao_Paulo
- DATABASE_URL=postgresql://${POSTGRES_USER:-gate_user}:${POSTGRES_PASSWORD:-gate_pass}@db:5432/${POSTGRES_DB:-gate_watch}
- IMAGES_PATH=/app/images
- PORT=8080
- RUST_LOG=${RUST_LOG:-info}
- TELEGRAM_TOKEN=${TELEGRAM_TOKEN}
- PASSAGE_DEBOUNCE_SECONDS=${PASSAGE_DEBOUNCE_SECONDS:-30}
env_file:
- .env
networks:
- gate-watch-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '2'
memory: 512M
reservations:
cpus: '0.5'
memory: 128M
db:
image: postgres:16-alpine
container_name: gate-watch-db
restart: unless-stopped
shm_size: 256mb
environment:
POSTGRES_USER: ${POSTGRES_USER:-gate_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-gate_pass}
POSTGRES_DB: ${POSTGRES_DB:-gate_watch}
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C"
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
networks:
- gate-watch-network
volumes:
- ./data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
pgbackups:
image: prodrigestivill/postgres-backup-local:latest
container_name: gate-watch-pgbackups
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
- TZ=America/Sao_Paulo
- POSTGRES_HOST=db
- POSTGRES_DB=${POSTGRES_DB:-gate_watch}
- POSTGRES_USER=${POSTGRES_USER:-gate_user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-gate_pass}
- SCHEDULE=@daily
- BACKUP_KEEP_DAYS=7
- BACKUP_KEEP_WEEKS=4
- BACKUP_KEEP_MONTHS=6
- BACKUP_ON_START=TRUE
volumes:
- ./pgbackups:/backups
networks:
- gate-watch-network
adminer:
image: adminer:latest
container_name: adminer-dev
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- "8081:8080"
environment:
ADMINER_DEFAULT_SERVER: db
networks:
- gate-watch-network
networks:
gate-watch-network:
driver: bridge