forked from Joohansson/NanoRPCProxy
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
43 lines (31 loc) · 905 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:18 AS build
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:18
WORKDIR /app
# Setup environment variables for docker
ENV CONFIG_CREDS_SETTINGS=/root/creds.json \
CONFIG_POW_CREDS_SETTINGS=/root/pow_creds.json \
CONFIG_REQUEST_STAT=/root/request-stat.json \
CONFIG_SETTINGS=/root/settings.json \
CONFIG_TOKEN_SETTINGS=/root/token_settings.json \
CONFIG_USER_SETTINGS=/root/user_settings.json \
CONFIG_WEBSOCKET_PATH=/root/websocket.json \
CONFIG_DB_PATH=/root/db.json
# Install dependencies
COPY package*.json ./
RUN npm ci --production
# Copy build files from build stage
COPY --from=build /usr/src/app/dist ./dist
VOLUME /root
EXPOSE 9950
CMD [ "node", "dist/proxy.js" ]