Merge branch 'develop' into testing
This commit is contained in:
commit
d018ce7f0a
0
deploy/.env.dist
Normal file
0
deploy/.env.dist
Normal file
4
deploy/.env.local
Normal file
4
deploy/.env.local
Normal file
@ -0,0 +1,4 @@
|
||||
API_GATEWAY_PORT=48443
|
||||
API_GATEWAY_UI_PORT=48444
|
||||
API_REGISTRY_UI_PORT=48445
|
||||
API_EVENTBUS_UI_PORT=48446
|
@ -2,10 +2,12 @@ version: "3.9"
|
||||
|
||||
services:
|
||||
api-gateway:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=egommerce.local
|
||||
# - APP_PORT=48443
|
||||
ports:
|
||||
- '8443:443'
|
||||
- '40056:443'
|
||||
- '40057:8080'
|
||||
- '5672:5672'
|
||||
|
||||
@ -13,15 +15,18 @@ services:
|
||||
command: ["-bootstrap-expect=1", "-ui-content-path=/registry", -log-level=DEBUG]
|
||||
environment:
|
||||
- APP_DOMAIN=registry.egommerce.local
|
||||
# - APP_PORT=48445
|
||||
ports:
|
||||
- '8300:8300'
|
||||
# - '8300:8300'
|
||||
- '40058:8500'
|
||||
# - '8600:8600'
|
||||
- '8600:8600/udp'
|
||||
|
||||
api-eventbus:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=eventbus.egommerce.local
|
||||
# - APP_PORT=48446
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.tcp.routers.eventbus.rule=HostSNI(`*`)
|
||||
@ -33,107 +38,120 @@ services:
|
||||
- '15672:15672'
|
||||
|
||||
api-cache:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=redis.egommerce.local
|
||||
command: ["redis-server", "/etc/redis.conf", "--requirepass", "12345678"]
|
||||
ports:
|
||||
- '6379:6379'
|
||||
- 6379:6379
|
||||
|
||||
api-logger:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=logger.egommerce.local
|
||||
ports:
|
||||
- '24224:24224'
|
||||
- 24224:24224
|
||||
|
||||
# api-prometheus:
|
||||
# environment:
|
||||
# - APP_DOMAIN=prometheus.egommerce.local
|
||||
# ports:
|
||||
# - '9090:9090'
|
||||
# - 9090:9090
|
||||
|
||||
# api-grafana:
|
||||
# environment:
|
||||
# - APP_DOMAIN=grafana.egommerce.local
|
||||
# ports:
|
||||
# - '3000:3000'
|
||||
# - 3000:3000
|
||||
|
||||
postgres-db:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=postgres.egommerce.local
|
||||
ports:
|
||||
- '5432:5432'
|
||||
- 5432:5432
|
||||
|
||||
mongo-db:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=mongo.egommerce.local
|
||||
ports:
|
||||
- '27017:27017'
|
||||
- 27017:27017
|
||||
|
||||
identity-svc:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=identity.api.egommerce.local
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
|
||||
ports:
|
||||
- '8080:80'
|
||||
- 8080:80
|
||||
|
||||
basket-svc:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=basket.api.egommerce.local
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
|
||||
ports:
|
||||
- '8001:80'
|
||||
- 8001:80
|
||||
|
||||
catalog-svc:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=catalog.api.egommerce.local
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
|
||||
ports:
|
||||
- '8002:80'
|
||||
- 8002:80
|
||||
|
||||
order-svc:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=order.api.egommerce.local
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
|
||||
ports:
|
||||
- '8003:80'
|
||||
- 8003:80
|
||||
|
||||
pricing-svc:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- APP_DOMAIN=pricing.api.egommerce.local
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
|
||||
ports:
|
||||
- '8004:80'
|
||||
- 8004:80
|
||||
|
||||
# Workers (EventBus)
|
||||
basket-worker:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
|
||||
|
||||
catalog-worker:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
|
||||
|
||||
pricing-worker:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@api-eventbus:5672
|
||||
|
||||
order-worker:
|
||||
env_file: .env.local
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:12345678@postgres-db:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongo-db:27017
|
||||
|
@ -11,6 +11,8 @@ services:
|
||||
environment:
|
||||
- APP_DOMAIN=api-registry
|
||||
- CONSUL_HTTP_TOKEN=devop
|
||||
volumes:
|
||||
- ./certs/api-registry:/consul/data/certs
|
||||
|
||||
api-eventbus:
|
||||
image: git.pbiernat.dev/egommerce/api-eventbus:dev
|
||||
@ -45,8 +47,6 @@ services:
|
||||
environment:
|
||||
- APP_DOMAIN=postgres-db
|
||||
- POSTGRES_PASSWORD=12345678
|
||||
# ports:
|
||||
# - '5432:5432'
|
||||
|
||||
mongo-db:
|
||||
environment:
|
||||
|
@ -316,6 +316,7 @@ volumes:
|
||||
#grafana-db: ~
|
||||
|
||||
networks:
|
||||
# Infrastructure networks
|
||||
api-gateway-network:
|
||||
driver: overlay
|
||||
#internal: true
|
||||
@ -352,7 +353,7 @@ networks:
|
||||
driver: overlay
|
||||
#internal: true
|
||||
|
||||
# api micro-services networks
|
||||
# Micro-services networks
|
||||
identity-svc-network:
|
||||
driver: overlay
|
||||
#internal: true
|
||||
@ -374,10 +375,6 @@ networks:
|
||||
#internal: true
|
||||
|
||||
# Workers networks
|
||||
# identity-worker-network:
|
||||
# driver: overlay
|
||||
# internal: true
|
||||
|
||||
basket-worker-network:
|
||||
driver: overlay
|
||||
#internal: true
|
||||
|
109
deploy/nginx-vhost.local.conf
Normal file
109
deploy/nginx-vhost.local.conf
Normal 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user