addon and consumer. Todo: producer Change DATABASE_URI to be generic POSTGRES variables DOES NOT WORK - First pass at upgrading environment variables PostgreSQL environment variables have been split for addon and consumer. ENABLE_SYNC hard coded as `true` MongoDB variables update. Make the addon code more similar to the consumer code Get some parity between addon and consumer
119 lines
2.2 KiB
YAML
119 lines
2.2 KiB
YAML
version: '3.8'
|
|
name: knightcrawler
|
|
|
|
x-restart: &restart-policy
|
|
"unless-stopped"
|
|
|
|
x-basehealth: &base-health
|
|
interval: 10s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
x-rabbithealth: &rabbitmq-health
|
|
test: rabbitmq-diagnostics -q ping
|
|
<<: *base-health
|
|
|
|
x-mongohealth: &mongodb-health
|
|
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
|
|
<<: *base-health
|
|
|
|
x-postgreshealth: &postgresdb-health
|
|
test: pg_isready
|
|
<<: *base-health
|
|
|
|
x-apps: &knightcrawler-app
|
|
depends_on:
|
|
mongodb:
|
|
condition: service_healthy
|
|
postgres:
|
|
condition: service_healthy
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
restart: *restart-policy
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:latest
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
PGUSER: postgres # needed for healthcheck.
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres:/var/lib/postgresql/data
|
|
healthcheck: *postgresdb-health
|
|
restart: *restart-policy
|
|
networks:
|
|
- knightcrawler-network
|
|
|
|
mongodb:
|
|
image: mongo:latest
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "27017:27017"
|
|
volumes:
|
|
- mongo:/data/db
|
|
restart: *restart-policy
|
|
healthcheck: *mongodb-health
|
|
networks:
|
|
- knightcrawler-network
|
|
|
|
rabbitmq:
|
|
image: rabbitmq:3-management
|
|
ports:
|
|
- "5672:5672"
|
|
- "15672:15672"
|
|
- "15692:15692"
|
|
volumes:
|
|
- rabbitmq:/var/lib/rabbitmq
|
|
restart: *restart-policy
|
|
healthcheck: *rabbitmq-health
|
|
networks:
|
|
- knightcrawler-network
|
|
|
|
producer:
|
|
build:
|
|
context: src/producer
|
|
dockerfile: Dockerfile
|
|
env_file:
|
|
- .env
|
|
<<: *knightcrawler-app
|
|
networks:
|
|
- knightcrawler-network
|
|
|
|
consumer:
|
|
build:
|
|
context: src/node/consumer
|
|
dockerfile: Dockerfile
|
|
env_file:
|
|
- .env
|
|
deploy:
|
|
replicas: 3
|
|
<<: *knightcrawler-app
|
|
networks:
|
|
- knightcrawler-network
|
|
|
|
addon:
|
|
build:
|
|
context: src/node/addon
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "7000:7000"
|
|
env_file:
|
|
- .env
|
|
<<: *knightcrawler-app
|
|
networks:
|
|
- knightcrawler-network
|
|
|
|
networks:
|
|
knightcrawler-network:
|
|
driver: bridge
|
|
name: knightcrawler-network
|
|
|
|
volumes:
|
|
postgres:
|
|
mongo:
|
|
rabbitmq: |