-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDockerfile
43 lines (31 loc) · 880 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
39
40
41
42
43
# Build stage #
FROM node:14
WORKDIR /usr/src/app
# Prepare environment
COPY ./package*.json ./
COPY ./tsconfig.json ./
RUN npm ci
# Copy source files
COPY ./src ./src
# Typescript → Javascript
RUN npm run-script build
# Deploy stage #
FROM node:14
WORKDIR /app
# Setup environment variables for docker
ENV CONFIG_CREDS_SETTINGS=/root/creds.json
ENV CONFIG_POW_CREDS_SETTINGS=/root/pow_creds.json
ENV CONFIG_REQUEST_STAT=/root/request-stat.json
ENV CONFIG_SETTINGS=/root/settings.json
ENV CONFIG_TOKEN_SETTINGS=/root/token_settings.json
ENV CONFIG_USER_SETTINGS=/root/user_settings.json
ENV CONFIG_WEBSOCKET_PATH=/root/websocket.json
ENV CONFIG_DB_PATH=/root/db.json
# Install dependencies
COPY ./package*.json ./
RUN npm ci --production
# Copy build files from stage 0
COPY --from=0 /usr/src/app/dist ./dist
VOLUME /root
EXPOSE 9950
CMD [ "node", "dist/proxy.js" ]