add docker-compose.yaml (cópia) p/ casar o default do Coolify
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
e5d3504646
commit
6be66349ba
@@ -0,0 +1,151 @@
|
|||||||
|
# ============================================================================
|
||||||
|
# Rastro — Compose "INTERNET" (servidor com acesso externo).
|
||||||
|
# • Infra (db/rabbitmq/minio/gotenberg): direto do Docker Hub.
|
||||||
|
# • App (rastro-node/analytics): do Gitea EXTERNO (gitea.externo.utic.app.br) —
|
||||||
|
# pacotes públicos, pull anônimo (sem login).
|
||||||
|
# Uso: coloque este arquivo + o .env na mesma pasta e rode `docker compose up -d`
|
||||||
|
# (ou aponte o Coolify para ele). Depois: restaurar o dump + ajustar domínios.
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
x-app-env: &app-env
|
||||||
|
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
|
||||||
|
RABBITMQ_URL: amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq:5672
|
||||||
|
RASTRO_EXCHANGE: rastro.passagens
|
||||||
|
RASTRO_QUEUE: rastro.passagens.processar
|
||||||
|
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: timescale/timescaledb-ha:pg16
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
|
shm_size: 1gb
|
||||||
|
volumes:
|
||||||
|
- db_data:/home/postgres/pgdata
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 15
|
||||||
|
|
||||||
|
rabbitmq:
|
||||||
|
image: rabbitmq:3-management
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
|
||||||
|
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
|
||||||
|
volumes:
|
||||||
|
- rabbitmq_data:/var/lib/rabbitmq
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'rabbitmq-diagnostics', '-q', 'ping']
|
||||||
|
interval: 15s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
|
minio:
|
||||||
|
image: minio/minio:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
command: server /data --console-address ":9001"
|
||||||
|
environment:
|
||||||
|
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
|
||||||
|
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- minio_data:/data
|
||||||
|
|
||||||
|
gotenberg:
|
||||||
|
image: gotenberg/gotenberg:8
|
||||||
|
restart: unless-stopped
|
||||||
|
command: [gotenberg, --chromium-disable-javascript=false, --api-timeout=60s]
|
||||||
|
|
||||||
|
# Init: cria só o SCHEMA (usuários/config vêm do dump). Roda 1x e sai.
|
||||||
|
migrate:
|
||||||
|
image: gitea.externo.utic.app.br/ericoalmeida/rastro-node:latest
|
||||||
|
restart: "no"
|
||||||
|
depends_on:
|
||||||
|
db: { condition: service_healthy }
|
||||||
|
environment:
|
||||||
|
<<: *app-env
|
||||||
|
NODE_ENV: production
|
||||||
|
DB_CONNECTION_LIMIT: '5'
|
||||||
|
command: >
|
||||||
|
sh -c "wait-for-db &&
|
||||||
|
pnpm --filter @rastro/db migrate &&
|
||||||
|
pnpm --filter @rastro/db postgis &&
|
||||||
|
pnpm --filter @rastro/db timescale &&
|
||||||
|
pnpm --filter @rastro/db intel &&
|
||||||
|
pnpm --filter @rastro/db analyze"
|
||||||
|
|
||||||
|
processor:
|
||||||
|
image: gitea.externo.utic.app.br/ericoalmeida/rastro-node:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
db: { condition: service_healthy }
|
||||||
|
environment:
|
||||||
|
<<: *app-env
|
||||||
|
NODE_ENV: production
|
||||||
|
DB_CONNECTION_LIMIT: '8'
|
||||||
|
OSRM_URL: ${OSRM_URL:-http://osrm:5000}
|
||||||
|
REROUTE_STALE_INTERVAL_MIN: '15'
|
||||||
|
command: sh -c "wait-for-db schema rabbitmq && pnpm --filter @rastro/processor start"
|
||||||
|
|
||||||
|
analytics:
|
||||||
|
image: gitea.externo.utic.app.br/ericoalmeida/rastro-analytics:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
db: { condition: service_healthy }
|
||||||
|
environment:
|
||||||
|
<<: *app-env
|
||||||
|
INTEL_TOP_COMPANIES: '200'
|
||||||
|
INTEL_TOP_COMMODITIES: '50'
|
||||||
|
INTEL_HORIZON_WEEKS: '8'
|
||||||
|
INTEL_CYCLE_HOURS: '24'
|
||||||
|
|
||||||
|
backend:
|
||||||
|
image: gitea.externo.utic.app.br/ericoalmeida/rastro-node:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
db: { condition: service_healthy }
|
||||||
|
environment:
|
||||||
|
<<: *app-env
|
||||||
|
NODE_ENV: production
|
||||||
|
DB_CONNECTION_LIMIT: '12'
|
||||||
|
BACKEND_PORT: '39010'
|
||||||
|
JWT_SECRET: ${JWT_SECRET}
|
||||||
|
SESSION_COOKIE_NAME: rastro_session
|
||||||
|
CORS_ORIGINS: https://${WEB_DOMAIN},https://${ADMIN_DOMAIN}
|
||||||
|
RATE_LIMIT_MAX: '1000'
|
||||||
|
GOTENBERG_URL: http://gotenberg:3000
|
||||||
|
MINIO_ENDPOINT: minio
|
||||||
|
MINIO_PORT: '9000'
|
||||||
|
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
|
||||||
|
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
|
||||||
|
MINIO_BUCKET: rastro-photos
|
||||||
|
command: sh -c "wait-for-db schema && pnpm --filter @rastro/backend start"
|
||||||
|
expose: ["39010"]
|
||||||
|
|
||||||
|
web:
|
||||||
|
image: gitea.externo.utic.app.br/ericoalmeida/rastro-node:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
<<: *app-env
|
||||||
|
VITE_DEV_HELPERS: 'false'
|
||||||
|
PREVIEW_ALLOWED_HOSTS: ${WEB_DOMAIN}
|
||||||
|
command: sh -c "pnpm --filter web preview --host 0.0.0.0 --port 39000"
|
||||||
|
expose: ["39000"]
|
||||||
|
|
||||||
|
admin:
|
||||||
|
image: gitea.externo.utic.app.br/ericoalmeida/rastro-node:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
<<: *app-env
|
||||||
|
VITE_DEV_HELPERS: 'false'
|
||||||
|
PREVIEW_ALLOWED_HOSTS: ${ADMIN_DOMAIN}
|
||||||
|
command: sh -c "pnpm --filter admin preview --host 0.0.0.0 --port 39020"
|
||||||
|
expose: ["39020"]
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db_data:
|
||||||
|
rabbitmq_data:
|
||||||
|
minio_data:
|
||||||
Reference in New Issue
Block a user