Created
December 3, 2020 18:53
-
-
Save aspen-roller/3517cd3e85ab2edb86b2f37fef7cd9cc to your computer and use it in GitHub Desktop.
Node.js docker-compose #nodejs #docker
This file contains hidden or 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
# Assumptions | |
# node_modules installed under /opt | |
# application installed under /opt/app | |
# Simple Build Commands | |
docker image build -t ultimate:dev --target dev . | |
docker image build -t ultimate:test --target test . # update below for MICROSCANNER | |
docker image build -t ultimate:prod --target prod . | |
# MUST pass ARGs as --build-arg | |
# TOKEN stored as environment variable | |
docker image build -t ultimate:test --target test --build-arg=MICROSCANNER_TOKEN=$MICROSCANNER_TOKEN . | |
# Handle non-graceful node.js shutdowns to run images | |
docker run --init ultimate:test | |
docker run --init ultimate:prod | |
docker run --init -v $(pwd):/opt/app ultimate:dev | |
docker-compose up # alternative to above, compose file targets local build for the "dev" stage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment