stack/deploy/egommerce-stack.yml

279 lines
6.5 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
2022-11-30 02:20:48 +01:00
networks:
- api-gateway-network
2022-12-06 07:36:17 +01:00
# - api-logger-network # TODO
2022-11-30 02:20:48 +01:00
- identity-svc-network
- basket-svc-network
- catalog-svc-network
- order-svc-network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
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-06 07:36:17 +01:00
volumes:
- registry_data:/consul/data
2022-11-30 02:20:48 +01:00
networks:
- api-registry-network
2022-12-06 07:36:17 +01:00
# - api-logger-network # TODO
2022-11-30 02:20:48 +01:00
- api-gateway-network
- identity-svc-network
- basket-svc-network
- catalog-svc-network
- order-svc-network
2022-12-06 07:36:17 +01:00
- basket-worker-network
- catalog-worker-network
- order-worker-network
2022-11-30 02:20:48 +01:00
api-eventbus:
image: git.pbiernat.dev/egommerce/api-eventbus:latest
environment:
# - RABBITMQ_NODENAME=api-eventbus
- 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
# labels:
# - "traefik.enable=true"
# - "traefik.tcp.routers.eventbus-svc.rule=HostSNI(`*`)"
# - "traefik.tcp.routers.eventbus-svc.service=eventbus-svc"
# - "traefik.tcp.routers.eventbus-svc.entryPoints=eventbus"
# - "traefik.tcp.services.eventbus-svc.loadbalancer.server.port=5672"
networks:
- api-eventbus-network
- api-registry-network
- api-logger-network
api-logger:
image: git.pbiernat.dev/egommerce/api-logger:latest
environment:
- APP_NAME=api-logger
- APP_DOMAIN
networks:
- api-logger-network
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
# labels:
# - "traefik.enable=true"
# - "traefik.tcp.routers.postgres-svc.service=postgres-svc"
# - "traefik.tcp.routers.postgres-svc.entryPoints=db"
# - "traefik.tcp.services.postgres-svc.loadbalancer.server.port=5432"
volumes:
- postgres_data:/var/lib/postgresql/data
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
# labels:
# - "traefik.enable=true"
# - "traefik.tcp.routers.mongodb-svc.service=mongodb-svc"
# - "traefik.tcp.routers.mongodb-svc.entryPoints=mongodb"
# - "traefik.tcp.services.mongodb-svc.loadbalancer.server.port=27017"
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
- 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-10-06 20:40:27 +02:00
networks:
2022-11-30 02:20:48 +01:00
- identity-svc-network
- 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
- 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-10-06 20:40:27 +02:00
networks:
2022-11-30 02:20:48 +01:00
- basket-svc-network
- 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
- 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
networks:
- catalog-svc-network
- 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
- 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
networks:
- order-svc-network
- 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
- 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
- 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
- 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: ~
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
internal: true
2022-11-30 02:20:48 +01:00
api-registry-network:
driver: overlay
internal: true
api-eventbus-network:
driver: overlay
internal: true
api-logger-network:
driver: overlay
internal: true
postgres-db-network:
driver: overlay
internal: true
mongodb-db-network:
driver: overlay
internal: true
# api micro-services networks
identity-svc-network:
driver: overlay
internal: true
basket-svc-network:
driver: overlay
internal: true
catalog-svc-network:
driver: overlay
internal: true
order-svc-network:
driver: overlay
internal: true
# Workers networks
# identity-worker-network:
# driver: overlay
# internal: true
basket-worker-network:
2022-10-06 20:40:27 +02:00
driver: overlay
internal: true
2022-11-30 02:20:48 +01:00
catalog-worker-network:
2022-10-06 20:40:27 +02:00
driver: overlay
internal: true
2022-11-30 02:20:48 +01:00
order-worker-network:
2022-10-06 20:40:27 +02:00
driver: overlay
internal: true