This app create with Nest.js framework.
npm install
# development
npm run start
# watch mode
npm run start:dev
# production mode
npm run start:prod
FROM - The base image to use in the build. This is mandatory and must be the first command in the file.
COPY - Adds files from your Docker client’s current directory.
RUN - Executes a command and save the result as a new layer
WORKDIR - Set the default working directory for the container
EXPOSE - Opens a port for linked containers
CMD - The command that runs when the container starts
Build container
docker build -t ${CONTAINER_NAME} .
Start container
docker run -p ${PORT} ${CONTAINER_NAME}
Read more here about Heroku
Login to the registry:
heroku container:login
Create a Heroku app:
heroku create
#That command will return an app name, copy it to use it for the next command.
heroku container:push web --app ${YOUR_APP_NAME}
And realase
heroku container:release web --app ${YOUR_APP_NAME}
Dockerfile must be capitalized!