services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} POSTGRES_DB: ${POSTGRES_DB:-wallet_tracker} ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-wallet_tracker}"] interval: 5s timeout: 3s retries: 20 redis: image: redis:7-alpine restart: unless-stopped ports: - "6379:6379" volumes: - redisdata:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 20 # prometheus: scrape http://app:3000/metrics, interval: 15s # (drop a sidecar Prometheus container here pointed at app:3000) app: build: context: . dockerfile: Dockerfile restart: unless-stopped env_file: - .env environment: DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/wallet_tracker?schema=public} REDIS_URL: ${REDIS_URL:-redis://redis:6379} API_PORT: ${API_PORT:-3000} command: ["sh", "-c", "npx prisma migrate deploy && node dist/api/server.js"] ports: - "${API_PORT:-3000}:3000" depends_on: postgres: condition: service_healthy redis: condition: service_healthy healthcheck: test: ["CMD-SHELL", "wget -qO- http://localhost:3000/health || exit 1"] interval: 10s timeout: 3s retries: 10 start_period: 20s worker: build: context: . dockerfile: Dockerfile restart: unless-stopped env_file: - .env environment: DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/wallet_tracker?schema=public} REDIS_URL: ${REDIS_URL:-redis://redis:6379} command: ["node", "dist/worker.js"] depends_on: postgres: condition: service_healthy redis: condition: service_healthy app: condition: service_healthy listeners: build: context: . dockerfile: Dockerfile restart: unless-stopped env_file: - .env environment: DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/wallet_tracker?schema=public} REDIS_URL: ${REDIS_URL:-redis://redis:6379} YELLOWSTONE_ENDPOINT: ${YELLOWSTONE_ENDPOINT:-} YELLOWSTONE_TOKEN: ${YELLOWSTONE_TOKEN:-} command: ["node", "dist/index.js"] depends_on: postgres: condition: service_healthy redis: condition: service_healthy app: condition: service_healthy bot: build: context: . dockerfile: Dockerfile restart: unless-stopped env_file: - .env environment: DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/wallet_tracker?schema=public} REDIS_URL: ${REDIS_URL:-redis://redis:6379} command: ["node", "dist/bot/index.js"] depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: pgdata: redisdata: