FROM node:alpine
Use docker base image
RUN mkdir -p usr/src/server
Create application directory
WORKDIR /usr/src/server
Set working directory of the container for all RUN commands
COPY package.json /usr/src/server/
Copy package.json file which contain all dependencies required for application
RUN npm install
Install dependencies from package.json
COPY . /usr/src/server
Copy all other files from local machine to container
EXPOSÉ 3000
xpose container port to the host machine
CMD [ “node”
“server. js”]
A start command to run the application