Skip to content

Instantly share code, notes, and snippets.

@ptflp
Created August 17, 2021 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptflp/66d9da1ad629d199f7c40a5f00ba7e36 to your computer and use it in GitHub Desktop.
Save ptflp/66d9da1ad629d199f7c40a5f00ba7e36 to your computer and use it in GitHub Desktop.
nodejs docker-compose
version: '3.3'
services:
frontend:
container_name: frontend_${NODE_ENV}
image: node:14-stretch
command: npm run start
restart: always
working_dir: /app
environment:
- VIRTUAL_HOST=${ENDPOINT}
- LETSENCRYPT_HOST=${ENDPOINT}
- VIRTUAL_PORT=3000
- NODE_ENV=${NODE_ENV}
networks:
- skynet
volumes:
- ./:/app
builder:
container_name: builder_${NODE_ENV}
image: node:14-stretch
command: sh -c "rm -rf ./node_modules && npm install && npm run build"
working_dir: /app
networks:
- skynet
volumes:
- ./:/app
networks:
skynet:
external:
name: skynet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment