Merge branch 'develop' into testing

This commit is contained in:
Piotr Biernat 2023-06-25 00:52:27 +02:00
commit d018ce7f0a
6 changed files with 148 additions and 20 deletions

0
deploy/.env.dist Normal file
View File

4
deploy/.env.local Normal file
View File

@ -0,0 +1,4 @@
API_GATEWAY_PORT=48443
API_GATEWAY_UI_PORT=48444
API_REGISTRY_UI_PORT=48445
API_EVENTBUS_UI_PORT=48446

View File

@ -2,10 +2,12 @@ version: "3.9"
services: services:
api-gateway: api-gateway:
env_file: .env.local
environment: environment:
- APP_DOMAIN=egommerce.local - APP_DOMAIN=egommerce.local
# - APP_PORT=48443
ports: ports:
- '8443:443' - '40056:443'
- '40057:8080' - '40057:8080'
- '5672:5672' - '5672:5672'
@ -13,15 +15,18 @@ services:
command: ["-bootstrap-expect=1", "-ui-content-path=/registry", -log-level=DEBUG] command: ["-bootstrap-expect=1", "-ui-content-path=/registry", -log-level=DEBUG]
environment: environment:
- APP_DOMAIN=registry.egommerce.local - APP_DOMAIN=registry.egommerce.local
# - APP_PORT=48445
ports: ports:
- '8300:8300' # - '8300:8300'
- '40058:8500' - '40058:8500'
# - '8600:8600' # - '8600:8600'
- '8600:8600/udp' - '8600:8600/udp'
api-eventbus: api-eventbus:
env_file: .env.local
environment: environment:
- APP_DOMAIN=eventbus.egommerce.local - APP_DOMAIN=eventbus.egommerce.local
# - APP_PORT=48446
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.tcp.routers.eventbus.rule=HostSNI(`*`) - traefik.tcp.routers.eventbus.rule=HostSNI(`*`)
@ -33,107 +38,120 @@ services:
- '15672:15672' - '15672:15672'
api-cache: api-cache:
env_file: .env.local
environment: environment:
- APP_DOMAIN=redis.egommerce.local - APP_DOMAIN=redis.egommerce.local
command: ["redis-server", "/etc/redis.conf", "--requirepass", "12345678"] command: ["redis-server", "/etc/redis.conf", "--requirepass", "12345678"]
ports: ports:
- '6379:6379' - 6379:6379
api-logger: api-logger:
env_file: .env.local
environment: environment:
- APP_DOMAIN=logger.egommerce.local - APP_DOMAIN=logger.egommerce.local
ports: ports:
- '24224:24224' - 24224:24224
# api-prometheus: # api-prometheus:
# environment: # environment:
# - APP_DOMAIN=prometheus.egommerce.local # - APP_DOMAIN=prometheus.egommerce.local
# ports: # ports:
# - '9090:9090' # - 9090:9090
# api-grafana: # api-grafana:
# environment: # environment:
# - APP_DOMAIN=grafana.egommerce.local # - APP_DOMAIN=grafana.egommerce.local
# ports: # ports:
# - '3000:3000' # - 3000:3000
postgres-db: postgres-db:
env_file: .env.local
environment: environment:
- APP_DOMAIN=postgres.egommerce.local - APP_DOMAIN=postgres.egommerce.local
ports: ports:
- '5432:5432' - 5432:5432
mongo-db: mongo-db:
env_file: .env.local
environment: environment:
- APP_DOMAIN=mongo.egommerce.local - APP_DOMAIN=mongo.egommerce.local
ports: ports:
- '27017:27017' - 27017:27017
identity-svc: identity-svc:
env_file: .env.local
environment: environment:
- APP_DOMAIN=identity.api.egommerce.local - APP_DOMAIN=identity.api.egommerce.local
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672 - EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
ports: ports:
- '8080:80' - 8080:80
basket-svc: basket-svc:
env_file: .env.local
environment: environment:
- APP_DOMAIN=basket.api.egommerce.local - APP_DOMAIN=basket.api.egommerce.local
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672 - EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
ports: ports:
- '8001:80' - 8001:80
catalog-svc: catalog-svc:
env_file: .env.local
environment: environment:
- APP_DOMAIN=catalog.api.egommerce.local - APP_DOMAIN=catalog.api.egommerce.local
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672 - EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
ports: ports:
- '8002:80' - 8002:80
order-svc: order-svc:
env_file: .env.local
environment: environment:
- APP_DOMAIN=order.api.egommerce.local - APP_DOMAIN=order.api.egommerce.local
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672 - EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
ports: ports:
- '8003:80' - 8003:80
pricing-svc: pricing-svc:
env_file: .env.local
environment: environment:
- APP_DOMAIN=pricing.api.egommerce.local - APP_DOMAIN=pricing.api.egommerce.local
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672 - EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
ports: ports:
- '8004:80' - 8004:80
# Workers (EventBus) # Workers (EventBus)
basket-worker: basket-worker:
env_file: .env.local
environment: environment:
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672 - EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
catalog-worker: catalog-worker:
env_file: .env.local
environment: environment:
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672 - EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
pricing-worker: pricing-worker:
env_file: .env.local
environment: environment:
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672 - EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
order-worker: order-worker:
env_file: .env.local
environment: environment:
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce - DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017 - MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017

View File

@ -11,6 +11,8 @@ services:
environment: environment:
- APP_DOMAIN=api-registry - APP_DOMAIN=api-registry
- CONSUL_HTTP_TOKEN=devop - CONSUL_HTTP_TOKEN=devop
volumes:
- ./certs/api-registry:/consul/data/certs
api-eventbus: api-eventbus:
image: git.pbiernat.dev/egommerce/api-eventbus:dev image: git.pbiernat.dev/egommerce/api-eventbus:dev
@ -45,8 +47,6 @@ services:
environment: environment:
- APP_DOMAIN=postgres-db - APP_DOMAIN=postgres-db
- POSTGRES_PASSWORD=12345678 - POSTGRES_PASSWORD=12345678
# ports:
# - '5432:5432'
mongo-db: mongo-db:
environment: environment:

View File

@ -316,6 +316,7 @@ volumes:
#grafana-db: ~ #grafana-db: ~
networks: networks:
# Infrastructure networks
api-gateway-network: api-gateway-network:
driver: overlay driver: overlay
#internal: true #internal: true
@ -352,7 +353,7 @@ networks:
driver: overlay driver: overlay
#internal: true #internal: true
# api micro-services networks # Micro-services networks
identity-svc-network: identity-svc-network:
driver: overlay driver: overlay
#internal: true #internal: true
@ -374,10 +375,6 @@ networks:
#internal: true #internal: true
# Workers networks # Workers networks
# identity-worker-network:
# driver: overlay
# internal: true
basket-worker-network: basket-worker-network:
driver: overlay driver: overlay
#internal: true #internal: true

View File

@ -0,0 +1,109 @@
upstream egommerce-api-gw {
server 127.0.0.1:48443;
}
upstream egommerce-api-gw-dashboard {
server 127.0.0.1:48444;
}
upstream egommerce-api-registry-ui {
server 127.0.0.1:48445;
}
upstream egommerce-api-eventbus-mngmt {
server 127.0.0.1:48446;
}
server {
listen 443 ssl;
ssl_certificate /home/keedosn/workspace/golang/src/git.pbiernat.dev/egommerce/stack/deploy/certs/api-gateway/localhost.cert;
ssl_certificate_key /home/keedosn/workspace/golang/src/git.pbiernat.dev/egommerce/stack/deploy/certs/api-gateway/localhost.key;
server_name egommerce.local;
# Traefik redirects
location /dashboard {
if ($http_referer ~ (/gateway)) {
proxy_pass http://egommerce-api-gw-dashboard;
}
}
location /api {
if ($http_referer ~ (/gateway)) {
proxy_pass http://egommerce-api-gw-dashboard;
}
}
location /gateway/ {
proxy_pass http://egommerce-api-gw-dashboard/dashboard/;
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
}
# Consul redirects
location /ui {
if ($http_referer ~ (/registry)) {
proxy_pass http://egommerce-api-registry-ui;
}
}
location /v1 {
if ($http_referer ~ (/registry)) {
proxy_pass http://egommerce-api-registry-ui;
}
}
location /registry {
proxy_pass http://egommerce-api-registry-ui;
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
}
# RabbitMQ Mngmt redirects
location /eventbus {
return 302 /eventbus/;
}
location ~* /eventbus/api/(.*?)/(.*) {
proxy_pass http://egommerce-api-eventbus-mngmt/api/$1/%2F/$2?$query_string;
proxy_buffering off;
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~* /eventbus/(.*) {
rewrite ^/eventbus/(.*)$ /$1 break;
proxy_pass http://egommerce-api-eventbus-mngmt;
proxy_buffering off;
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Pass all requests to the API Gateway
location / {
proxy_pass https://egommerce-api-gw;
proxy_http_version 1.1;
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
}
error_log /var/log/nginx/egommerce.local-error.log;
access_log /var/log/nginx/egommerce.local-access.log combined;
}