-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
51 lines (35 loc) · 1.13 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
FROM node:8.15.1-alpine as builder
RUN apk update \
&& apk add --virtual build-dependencies \
build-base \
gcc \
wget \
git \
&& apk add \
bash
RUN npm install npm@latest -g
# Install python for native dependencies
RUN apk --no-cache add --virtual native-deps \
g++ gcc libgcc libstdc++ linux-headers make python && \
npm install --quiet node-gyp -g
WORKDIR /usr/noia-node
# Copy only package.json to skip image rebuilding, when a list of dependencies has not changed since last time
COPY ./package.json ./package.json
RUN npm install
# Copy the rest of the sources for building
COPY ./src ./src
COPY ./tsconfig.json .
# Build from sources
RUN npm run build
# Separate runtime from builder
FROM node:8.11.4-alpine
# Add libc6-compat
# https://github.com/grpc/grpc/issues/6126
RUN apk --no-cache add libc6-compat
WORKDIR /usr/noia-node
COPY --from=builder /usr/noia-node .
# Required ports
EXPOSE 8048/tcp 8058/udp
ENV NOIA_NODE_MASTER_ADDRESS wss://csl-masters.noia.network:5565
# Run application
ENTRYPOINT [ "node", "./dist/index.js"]