Skip to content

Commit

Permalink
setup basic docker-compose from Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed Mar 20, 2024
1 parent 3c69cb8 commit 449f387
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,14 @@ services:
dockerfile: Dockerfile
target: web
restart: unless-stopped

nginx:
image: nginx:alpine
ports:
- "4000:80" # Map port 80 on the host to port 80 in the NGINX container
volumes:
- ./nginx/etc/nginx/conf.d/:/etc/nginx/conf.d/
depends_on:
- api
- web
restart: unless-stopped
20 changes: 20 additions & 0 deletions nginx/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
upstream web {
server web:8080;
}

upstream api {
server api:3084;
}

server {
listen 80;

location / {
proxy_pass http://web;
}

location /api {
rewrite /api/(.*) /$1 break;
proxy_pass http://api;
}
}

0 comments on commit 449f387

Please sign in to comment.