stack/deploy/egommerce-stack.yml

390 lines
9.0 KiB
YAML
Raw Normal View History

2022-10-06 20:40:27 +02:00
version: "3.9"
services:
2022-11-30 02:20:48 +01:00
api-gateway:
image: git.pbiernat.dev/egommerce/api-gateway:latest
2022-12-06 07:36:17 +01:00
# command:
# - '--providers.consulcatalog.refreshinterval=5s'
# FIXME ^^ only on config option: static/env/cli must be selected
2022-11-30 02:20:48 +01:00
environment:
- APP_NAME=api-gateway
- APP_DOMAIN
2022-12-06 07:36:17 +01:00
- API_REGISTRY_REFRESH_INTERVAL=5s
2023-05-20 21:41:33 +02:00
volumes:
- /var/run/docker.sock:/var/run/docker.sock
2022-11-30 02:20:48 +01:00
networks:
- api-gateway-network
- api-registry-network
- api-logger-network
2022-11-30 02:20:48 +01:00
api-registry:
2022-12-02 22:03:33 +01:00
image: git.pbiernat.dev/egommerce/api-registry:latest
2022-11-30 02:20:48 +01:00
environment:
- APP_NAME=api-registry
- APP_DOMAIN
2022-12-25 23:21:27 +01:00
- CONSUL_HTTP_TOKEN=VeryS3cr3tTok3N
2022-12-06 07:36:17 +01:00
volumes:
- registry_data:/consul/data
2022-11-30 02:20:48 +01:00
networks:
- api-registry-network
- api-logger-network
2022-11-30 02:20:48 +01:00
api-eventbus:
image: git.pbiernat.dev/egommerce/api-eventbus:latest
environment:
# - RABBITMQ_NODENAME=api-eventbus
2023-05-20 21:41:33 +02:00
- RABBITMQ_ERLANG_COOKIE=rabbitmq
2022-11-30 02:20:48 +01:00
- APP_NAME=api-eventbus
- APP_DOMAIN
volumes:
2022-12-06 07:36:17 +01:00
- eventbus_data:/var/lib/rabbitmq
- eventbus_logs:/var/log/rabbitmq
2022-11-30 02:20:48 +01:00
networks:
2023-05-20 21:41:33 +02:00
- api-gateway-network
2022-11-30 02:20:48 +01:00
- api-eventbus-network
- api-registry-network
- api-logger-network
2022-12-25 23:21:27 +01:00
api-cache:
image: git.pbiernat.dev/egommerce/api-cache:latest
environment:
- APP_NAME=api-cache
networks:
- api-cache-network
- api-logger-network
2022-11-30 02:20:48 +01:00
api-logger:
image: git.pbiernat.dev/egommerce/api-logger:latest
environment:
- APP_NAME=api-logger
- APP_DOMAIN
networks:
- api-logger-network
2023-05-22 00:34:21 +02:00
#api-prometheus:
# image: prom/prometheus:latest # FIXME: create private image(prod/dev)...
# user: root
# environment:
# - APP_NAME=api-prometheus
# - APP_DOMAIN
# volumes:
# - ./etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
# - /var/run/docker.sock:/var/run/docker.sock
# networks:
# - api-prometheus-network
#- api-grafana-network
# - api-gateway-network
# - api-registry-network
# - api-eventbus-network
2023-05-20 21:41:33 +02:00
# - api-cache-network
# - api-logger-network
2023-05-22 00:34:21 +02:00
# - basket-svc-network
# - basket-worker-network
# - catalog-svc-network
# - catalog-worker-network
# - identity-svc-network
# - order-svc-network
# - order-worker-network
# - pricing-svc-network
# - pricing-worker-network
#api-grafana:
# image: grafana/grafana-oss:latest # FIXME: create private image(prod/dev)...
# environment:
# - APP_NAME=api-grafana
# - APP_DOMAIN
# volumes:
# - grafana-db:/var/lib/grafana
# networks:
# - api-grafana-network
2022-11-30 02:20:48 +01:00
postgres-db:
2022-10-06 20:40:27 +02:00
image: postgres:14.1-alpine
environment:
2022-11-30 02:20:48 +01:00
- APP_NAME=postgres-db
- APP_DOMAIN
2022-10-06 20:40:27 +02:00
- POSTGRES_USER=postgres
2022-11-30 02:20:48 +01:00
- POSTGRES_PASSWORD
volumes:
- postgres_data:/var/lib/postgresql/data
2023-05-22 00:18:08 +02:00
- ./db_migrations/init/:/docker-entrypoint-initdb.d/
2022-10-06 20:40:27 +02:00
networks:
2022-11-30 02:20:48 +01:00
- postgres-db-network
- api-logger-network
2022-10-06 20:40:27 +02:00
2022-11-30 02:20:48 +01:00
mongo-db:
image: mongo:5.0.14
environment:
- APP_NAME=mongo-db
- APP_DOMAIN
- MONGO_INITDB_ROOT_USERNAME=mongodb
- MONGO_INITDB_ROOT_PASSWORD
volumes:
- mongodb_data:/data/db
2022-10-06 20:40:27 +02:00
networks:
2022-11-30 02:20:48 +01:00
- mongodb-db-network
- api-logger-network
2022-10-06 20:40:27 +02:00
2022-11-30 02:20:48 +01:00
# API micro-services
identity-svc:
image: git.pbiernat.dev/egommerce/identity-svc:latest
2022-10-06 20:40:27 +02:00
environment:
2022-11-30 02:20:48 +01:00
- APP_NAME=identity-svc
2022-12-25 23:21:27 +01:00
- APP_PATH_PREFIX=/identity
2022-11-30 02:20:48 +01:00
- APP_DOMAIN
2022-12-06 07:36:17 +01:00
- APP_KV_NAMESPACE
2022-11-30 02:20:48 +01:00
- DATABASE_URL
2022-12-02 22:03:33 +01:00
- MONGODB_URL
2022-11-30 02:20:48 +01:00
- EVENTBUS_URL
2022-12-25 23:21:27 +01:00
volumes:
- ./db_migrations/identity-svc:/migrations
2022-10-06 20:40:27 +02:00
networks:
2022-11-30 02:20:48 +01:00
- identity-svc-network
2022-12-25 23:21:27 +01:00
- api-gateway-network
- api-registry-network
2022-11-30 02:20:48 +01:00
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
2022-10-06 20:40:27 +02:00
2022-11-30 02:20:48 +01:00
basket-svc:
image: git.pbiernat.dev/egommerce/basket-svc:latest
2022-10-06 20:40:27 +02:00
environment:
2022-11-30 02:20:48 +01:00
- APP_NAME=basket-svc
2022-12-25 23:21:27 +01:00
- APP_PATH_PREFIX=/basket
2022-11-30 02:20:48 +01:00
- APP_DOMAIN
2022-12-06 07:36:17 +01:00
- APP_KV_NAMESPACE
2022-11-30 02:20:48 +01:00
- DATABASE_URL
2022-12-02 22:03:33 +01:00
- MONGODB_URL
2022-11-30 02:20:48 +01:00
- EVENTBUS_URL
2022-12-25 23:21:27 +01:00
volumes:
- ./db_migrations/basket-svc:/migrations
2022-10-06 20:40:27 +02:00
networks:
2022-11-30 02:20:48 +01:00
- basket-svc-network
2023-06-01 21:54:00 +02:00
# - order-svc-network
# - pricing-svc-network
2022-12-25 23:21:27 +01:00
- api-gateway-network
- api-registry-network
2022-11-30 02:20:48 +01:00
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
catalog-svc:
image: git.pbiernat.dev/egommerce/catalog-svc:latest
environment:
- APP_NAME=catalog-svc
2022-12-25 23:21:27 +01:00
- APP_PATH_PREFIX=/catalog
2022-11-30 02:20:48 +01:00
- APP_DOMAIN
2022-12-06 07:36:17 +01:00
- APP_KV_NAMESPACE
2022-11-30 02:20:48 +01:00
- DATABASE_URL
2022-12-02 22:03:33 +01:00
- MONGODB_URL
2022-11-30 02:20:48 +01:00
- EVENTBUS_URL
2022-12-25 23:21:27 +01:00
volumes:
- ./db_migrations/catalog-svc:/migrations
2022-11-30 02:20:48 +01:00
networks:
- catalog-svc-network
2022-12-25 23:21:27 +01:00
- api-gateway-network
- api-registry-network
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
pricing-svc:
image: git.pbiernat.dev/egommerce/pricing-svc:latest
environment:
- APP_NAME=pricing-svc
- APP_PATH_PREFIX=/pricing
- APP_DOMAIN
- APP_KV_NAMESPACE
- DATABASE_URL
- MONGODB_URL
- EVENTBUS_URL
volumes:
- ./db_migrations/pricing-svc:/migrations
networks:
- pricing-svc-network
- api-gateway-network
- api-registry-network
2022-11-30 02:20:48 +01:00
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
order-svc:
image: git.pbiernat.dev/egommerce/order-svc:latest
environment:
- APP_NAME=order-svc
2022-12-25 23:21:27 +01:00
- APP_PATH_PREFIX=/order
2022-11-30 02:20:48 +01:00
- APP_DOMAIN
2022-12-06 07:36:17 +01:00
- APP_KV_NAMESPACE
2022-11-30 02:20:48 +01:00
- DATABASE_URL
2022-12-02 22:03:33 +01:00
- MONGODB_URL
2022-11-30 02:20:48 +01:00
- EVENTBUS_URL
2022-12-25 23:21:27 +01:00
volumes:
- ./db_migrations/order-svc:/migrations
2022-11-30 02:20:48 +01:00
networks:
- order-svc-network
2022-12-25 23:21:27 +01:00
- api-gateway-network
- api-registry-network
2022-11-30 02:20:48 +01:00
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
# Workers (EventBus)
basket-worker:
image: git.pbiernat.dev/egommerce/basket-worker:latest
environment:
- APP_NAME=basket-worker
2022-12-06 07:36:17 +01:00
- APP_KV_NAMESPACE
2022-11-30 02:20:48 +01:00
- DATABASE_URL
2022-12-02 22:03:33 +01:00
- MONGODB_URL
2022-11-30 02:20:48 +01:00
- EVENTBUS_URL
networks:
- basket-worker-network
2023-06-01 21:54:00 +02:00
# - pricing-svc-network
2023-05-20 21:41:33 +02:00
- api-gateway-network
2022-12-25 23:21:27 +01:00
- api-registry-network
2022-11-30 02:20:48 +01:00
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
catalog-worker:
image: git.pbiernat.dev/egommerce/catalog-worker:latest
environment:
- APP_NAME=catalog-worker
- DATABASE_URL
2022-12-02 22:03:33 +01:00
- MONGODB_URL
2022-11-30 02:20:48 +01:00
- EVENTBUS_URL
networks:
- catalog-worker-network
2023-05-20 21:41:33 +02:00
- api-gateway-network
2022-12-25 23:21:27 +01:00
- api-registry-network
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
pricing-worker:
image: git.pbiernat.dev/egommerce/pricing-worker:latest
environment:
- APP_NAME=pricing-worker
- DATABASE_URL
- MONGODB_URL
- EVENTBUS_URL
networks:
- pricing-worker-network
2023-05-20 21:41:33 +02:00
- api-gateway-network
2022-12-25 23:21:27 +01:00
- api-registry-network
2022-11-30 02:20:48 +01:00
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
order-worker:
image: git.pbiernat.dev/egommerce/order-worker:latest
environment:
- APP_NAME=order-worker
- DATABASE_URL
2022-12-02 22:03:33 +01:00
- MONGODB_URL
2022-11-30 02:20:48 +01:00
- EVENTBUS_URL
networks:
- order-worker-network
2022-12-25 23:21:27 +01:00
- basket-svc-network
2023-05-20 21:41:33 +02:00
- api-gateway-network
2022-12-25 23:21:27 +01:00
- api-registry-network
2022-11-30 02:20:48 +01:00
- api-eventbus-network
- api-logger-network
- postgres-db-network
- mongodb-db-network
volumes:
postgres_data: ~
mongodb_data: ~
2022-12-06 07:36:17 +01:00
registry_data: ~
eventbus_data: ~
eventbus_logs: ~
2023-05-22 00:34:21 +02:00
#grafana-db: ~
2022-10-06 20:40:27 +02:00
networks:
2022-11-30 02:20:48 +01:00
api-gateway-network:
2022-10-06 20:40:27 +02:00
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-10-06 20:40:27 +02:00
2022-11-30 02:20:48 +01:00
api-registry-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-11-30 02:20:48 +01:00
api-eventbus-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-11-30 02:20:48 +01:00
2022-12-25 23:21:27 +01:00
api-cache-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-12-25 23:21:27 +01:00
2022-11-30 02:20:48 +01:00
api-logger-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
api-prometheus-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2023-05-22 00:34:21 +02:00
#api-grafana-network:
# driver: overlay
# internal: true
2022-11-30 02:20:48 +01:00
postgres-db-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-11-30 02:20:48 +01:00
mongodb-db-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-11-30 02:20:48 +01:00
# api micro-services networks
identity-svc-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-11-30 02:20:48 +01:00
basket-svc-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-11-30 02:20:48 +01:00
catalog-svc-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-11-30 02:20:48 +01:00
2022-12-25 23:21:27 +01:00
pricing-svc-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-12-25 23:21:27 +01:00
2022-11-30 02:20:48 +01:00
order-svc-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-11-30 02:20:48 +01:00
# Workers networks
# identity-worker-network:
# driver: overlay
# internal: true
basket-worker-network:
2022-10-06 20:40:27 +02:00
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-10-06 20:40:27 +02:00
2022-11-30 02:20:48 +01:00
catalog-worker-network:
2022-10-06 20:40:27 +02:00
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-10-06 20:40:27 +02:00
2022-12-25 23:21:27 +01:00
pricing-worker-network:
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true
2022-12-25 23:21:27 +01:00
2022-11-30 02:20:48 +01:00
order-worker-network:
2022-10-06 20:40:27 +02:00
driver: overlay
2023-05-22 00:34:21 +02:00
#internal: true