Dockerfile - thuy-econsys/rails_app GitHub Wiki
# /Dockerfile
# base image
FROM node:current-slim
# specify the working directory location where commands can be executed
# otherwise it will be set in the root directory
# /usr/src/app in your image filesystem (never the host’s filesystem)
WORKDIR /usr/src/app
# Copy the file from your host to your current location.
COPY package.json .
# Run the command inside your image filesystem.
RUN npm install
# expose container port at runtime.
# not necessary if index.js is already listening on port 8080
EXPOSE 8080
# Run the specified command, npm start, within the container.
CMD [ "npm", "start" ]
# Copy the rest of your app's source code from your host to your image filesystem.
COPY . .
References