Skip to content

Instantly share code, notes, and snippets.

@PatrickHeneise
Created August 13, 2020 08:46
Show Gist options
  • Save PatrickHeneise/7d39b009fc92b76eed84f6aa0de225ae to your computer and use it in GitHub Desktop.
Save PatrickHeneise/7d39b009fc92b76eed84f6aa0de225ae to your computer and use it in GitHub Desktop.
docker-compose file for n*xt/node with nginx ssl proxy and path rewrites
version: "3"
services:
nginx:
image: nginx:latest
container_name: universal_nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/mime.types:/etc/nginx/mime.types
- ./certs/:/usr/share/certs/
- ./assets/:/usr/src/app/assets/
ports:
- 8080:8080
depends_on:
- api
- web
links:
- web
- api
api:
build:
context: ./api
dockerfile: Dockerfile
args:
env: development
volumes:
- ./api:/usr/src/api
working_dir: /usr/src/api
environment:
- PORT=3000
- NODE_ENV=development
restart: always
command: npm run dev
container_name: universal_api
ports:
- 3000:3000
web:
build:
context: ./web
dockerfile: Dockerfile
args:
env: development
volumes:
- ./web:/usr/src/web
working_dir: /usr/src/web
environment:
- PORT=5000
- BASE_URL=https://localhost:8080
- API_URL=http://api:3000/api
- API_URL_BROWSER=https://localhost:8080
- NODE_ENV=development
restart: always
command: npm run dev
container_name: universal_web
ports:
- 5000:5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment