generated from pokt-network/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
39 lines (28 loc) · 926 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
# Check out https://hub.docker.com/_/node to select a new base image
FROM node:16-slim
# Bind to all network interfaces so that it can be mapped to the host OS
ENV WATCH=true
ENV HOST=0.0.0.0
ENV PORT=3000
ENV PATH="${PATH}:/usr/src/gateway/node_modules/.bin"
# Increases the maximum amount of available threads for some I/O operations
ENV UV_THREADPOOL_SIZE=128
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git
RUN mkdir -p /usr/src/gateway
WORKDIR /usr/src/gateway
# 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 ./
# Installs the project
# Ignores installation scripts as of right now they're only used for development
# and may trigger errors
RUN npm ci --ignore-scripts
# Bundle app source code
COPY . .
# NPM build
RUN npm run build
EXPOSE ${PORT}
CMD ["npm", "run", "start"]