Skip to content

Commit

Permalink
Add docker-compose.yml
Browse files Browse the repository at this point in the history
update config of admin to add a basePath
  • Loading branch information
alphayax committed Nov 26, 2023
1 parent 8277c46 commit 8a33a10
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .compose/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
server {
listen 80;
index index.html index.htm;

location / {
proxy_pass http://front-client/;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}

location /admin/ {
proxy_pass http://front-admin/;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}

location /api-article/ {
proxy_pass http://api-article:8080/;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}

location /api-cart/ {
proxy_pass http://api-cart:8081/;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
48 changes: 48 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: '3'
services:

mongo:
image: mongo:4

redis:
image: redis:6

api-cart:
#image: alphayax/microservice-demo-cart-service:latest
build:
context: ./cart-service
environment:
REDIS_URI: "redis://redis:6379"
depends_on:
- redis

api-article:
#image: alphayax/microservice-demo-article-service:latest
build:
context: ./article-service
environment:
MONGODB_URI: "mongodb://mongo:27017"
depends_on:
- mongo

front-admin:
#image: alphayax/microservice-demo-frontend-admin:latest
build:
context: ./front-admin

front-client:
#image: alphayax/microservice-demo-frontend-user:latest
build:
context: ./front-user

ingress:
image: nginx:1.19
ports:
- "80:80"
volumes:
- ./.compose/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- api-cart
- api-article
- front-admin
- front-client
1 change: 1 addition & 0 deletions front-admin/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default defineConfig({
},
}),
],
base: '/admin/',
define: { 'process.env': {} },
resolve: {
alias: {
Expand Down

0 comments on commit 8a33a10

Please sign in to comment.