Created
August 17, 2021 08:11
-
-
Save ptflp/66d9da1ad629d199f7c40a5f00ba7e36 to your computer and use it in GitHub Desktop.
nodejs docker-compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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