-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (26 loc) · 832 Bytes
/
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
FROM debian:latest as dependencies
RUN apt-get update
RUN apt-get install -y apt-transport-https \
ca-certificates \
curl gnupg2 \
software-properties-common
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y nodejs
COPY package.json .
RUN npm install
RUN npm install pm2 -g
#-----------------------------------------------------------------------
FROM dependencies
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.docker.cmd="docker run -d -p 4000:4000 --name webserver --tag webserver-node:latest"
RUN adduser --system app --home /app
USER app
WORKDIR /app
COPY . /app
COPY --from=dependencies node_modules ./node_modules
ENV PORT=3000
ENV NODE_ENV=production
CMD pm2 start ./src/server.js
EXPOSE 3000