Docker
What is a container?
A container is a standard unit of software that encapsulates everything that programmers need to build, ship, and run applications.
What is a Dockerfile
?
The Dockerfile
is a text file that instructs Docker how to build an image.
# Use an official image
FROM node:9.4.0-alpine
# Copies files to the container
COPY app.js .
COPY package.json .
# Runs commands
RUN npm install &&\
apk update &&\
apk upgrade
# Make a port available outside the container
EXPOSE 8080
# Run a command when the container lunches
CMD ["node", "app.js"]