- infra/compose/nats.yml: NATS server with JetStream, persistence volume, healthcheck - infra/compose/dapr.yml: Dapr placement service for sidecar coordination - infra/dapr/: Dapr global config, pubsub component (NATS), statestore (Redis) - infra/compose/scraper.yml: add Dapr sidecar container + depends_on nats/dapr - docs/add-dapr-service.md: guide for integrating Dapr into new services - docs/add-new-app.md: add Dapr sidecar step - ARCHITECTURE.md: add NATS/Dapr to infra table + service mesh diagram - infra/README.md: update layout and deployment order - deploy-docker.yml: add nats.yml + dapr.yml to ALL_COMPOSE_FILES Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
services:
|
|
scraper-api:
|
|
container_name: scraper-api
|
|
image: ghcr.io/asepharyana/asepharyana-hub/scraper-api:sha-c4ecf8f
|
|
restart: always
|
|
depends_on:
|
|
dapr-placement:
|
|
condition: service_healthy
|
|
nats:
|
|
condition: service_healthy
|
|
networks:
|
|
app-shared-net:
|
|
aliases:
|
|
- scraper-api
|
|
env_file:
|
|
- ../../.env
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'curl -so /dev/null --connect-timeout 5 http://localhost:4091/ || test $? -eq 22']
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 30s
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379
|
|
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET is required}
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
- EXTERNAL_BROWSERLESS_WS=ws://100.121.180.82:3001
|
|
|
|
scraper-api-dapr:
|
|
container_name: scraper-api-dapr
|
|
image: daprio/daprd:latest
|
|
restart: always
|
|
depends_on:
|
|
dapr-placement:
|
|
condition: service_healthy
|
|
nats:
|
|
condition: service_healthy
|
|
networks:
|
|
- app-shared-net
|
|
command:
|
|
- './daprd'
|
|
- '--app-id=scraper-api'
|
|
- '--app-port=4091'
|
|
- '--dapr-http-port=3500'
|
|
- '--dapr-grpc-port=50001'
|
|
- '--placement-host-address=dapr-placement:50005'
|
|
- '--components-path=/components'
|
|
volumes:
|
|
- ../../infra/dapr/components:/components
|
|
|
|
networks:
|
|
app-shared-net:
|
|
name: app-shared-net
|
|
external: true
|