-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (44 loc) · 1.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM node
LABEL authors="Zidane Zine eddine"
# update dependencies and install curl
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
# COPY package*.json ./ \
# ./source ./
# This will copy everything from the source path
# --more of a convenience when testing locally.
COPY . .
# update each dependency in package.json to the latest version
# IMPORTANT : remember to update dependencies in later versions
RUN npm install -g npm-check-updates \
ncu -u \
npm install \
npm install express \
npm install dotenv \
npm install bcryptjs \
npm install crypto \
npm install jsonwebtoken \
npm install mongoose \
npm install morgan \
npm install cloudinary \
npm install cookie-parser \
npm install express-fileupload \
npm install rotating-file-stream \
npm install express-mongo-sanitize \
npm install express-rate-limit \
npm install helmet \
npm install nodemailer \
npm install swagger-ui-express \
npm install xss-clean
# If you are building your code for production
RUN npm ci --only=production
# Bundle app source
COPY . /app
EXPOSE 5000
CMD [ "node", "index.js" ]