-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (20 loc) · 752 Bytes
/
Dockerfile
File metadata and controls
20 lines (20 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#Each instruction in this file creates a new layer
#Here we are getting our node as Base image
FROM node:14.16-alpine3.10
# Install prerequisites
RUN apk update && apk add curl
#Creating a new directory for app files and setting path in the container
RUN mkdir -p /usr/src/app
#setting working directory in the container
WORKDIR /usr/src/app
#copying the package.json file(contains dependencies) from project source dir to container dir
COPY package.json /usr/src/app
# installing the dependencies into the container
RUN npm install
RUN npm -g i nodemon
#copying the source code of Application into the container dir
COPY . /usr/src/app
#container exposed network port number
EXPOSE 3000
#command to run within the container
CMD ["npm", "run", "local"]