-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
55 lines (46 loc) · 1.2 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
49
50
51
52
53
54
55
FROM node:12-slim
# Install git so npm can install git dependencies
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash -g root -G sudo -u 1001 life-server
WORKDIR /usr/src/app
RUN chown -R life-server:root .
USER life-server
# 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 ./
RUN npm install
# add directories
COPY bin bin
COPY certificates certificates
COPY common common
COPY src src
COPY test test
# add files
COPY \
.npmrc \
config.default.js \
LICENSE.md \
package.json \
README.md \
./
# This is used by default config.js as 'root' dir
# And if it doesn't exist, app will error with/
# Error: EEXIST: file already exists, mkdir '/usr/src/app/data/localhost'
RUN mkdir data
# Include default configuration
COPY config.default.js config.dev.js
#RUN openssl req \
# -new \
# -newkey rsa:4096 \
# -days 365 \
# -nodes \
# -x509 \
# -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" \
# -keyout privkey.pem \
# -out fullchain.pem
EXPOSE 7070
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
CMD ["node", "./bin/server", "start"]