services: postgres: image: postgres:16-alpine environment: POSTGRES_USER: nevup POSTGRES_PASSWORD: nevup POSTGRES_DB: nevup volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U nevup -d nevup"] interval: 2s timeout: 3s retries: 20 redis: image: redis:7-alpine command: ["redis-server", "--appendonly", "yes"] volumes: - redisdata:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 2s timeout: 3s retries: 20 migrate: build: . depends_on: postgres: condition: service_healthy environment: NODE_ENV: production LOG_LEVEL: info DATABASE_URL: postgres://nevup:nevup@postgres:5432/nevup # REDIS_URL / JWT_SECRET are unused by migrate.js / seed.js but the # shared config.js fails fast on missing required env vars. REDIS_URL: redis://redis:6379 JWT_SECRET: 97791d4db2aa5f689c3cc39356ce35762f0a73aa70923039d8ef72a2840a1b02 SEED_ON_START: "true" SEED_FILE: /app/data/nevup_seed_dataset.csv command: ["sh", "-c", "node src/migrate.js && node src/seed.js"] api: build: . depends_on: postgres: condition: service_healthy redis: condition: service_healthy migrate: condition: service_completed_successfully environment: PORT: 3000 NODE_ENV: production LOG_LEVEL: info DATABASE_URL: postgres://nevup:nevup@postgres:5432/nevup REDIS_URL: redis://redis:6379 JWT_SECRET: 97791d4db2aa5f689c3cc39356ce35762f0a73aa70923039d8ef72a2840a1b02 TRADE_EVENTS_STREAM: trade.events CONSUMER_GROUP: metrics-workers ports: - "3000:3000" command: ["node", "src/index.js"] restart: unless-stopped worker: build: . depends_on: postgres: condition: service_healthy redis: condition: service_healthy migrate: condition: service_completed_successfully environment: NODE_ENV: production LOG_LEVEL: info DATABASE_URL: postgres://nevup:nevup@postgres:5432/nevup REDIS_URL: redis://redis:6379 JWT_SECRET: 97791d4db2aa5f689c3cc39356ce35762f0a73aa70923039d8ef72a2840a1b02 TRADE_EVENTS_STREAM: trade.events CONSUMER_GROUP: metrics-workers command: ["node", "src/worker/index.js"] restart: unless-stopped volumes: pgdata: redisdata: