forked from dashevo/dapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (33 loc) · 1.14 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
# syntax = docker/dockerfile:1.2
FROM node:16-alpine as node_modules
RUN apk update && \
apk --no-cache upgrade && \
apk add --no-cache git \
openssh-client \
python3 \
alpine-sdk \
zeromq-dev
# Enable node-gyp cache
RUN npm install -g [email protected] && \
npm config set node_gyp node-gyp-cache
# Install npm modules
ENV npm_config_zmq_external=true
COPY package.json package-lock.json /
RUN --mount=type=cache,target=/root/.npm --mount=type=cache,target=/root/.cache npm ci --production
FROM node:16-alpine
ARG NODE_ENV=production
ENV NODE_ENV ${NODE_ENV}
LABEL maintainer="Dash Developers <[email protected]>"
LABEL description="DAPI Node.JS"
# Install ZMQ shared library
RUN apk update && apk add --no-cache zeromq-dev
# Copy NPM modules
COPY --from=node_modules /node_modules/ /node_modules
COPY --from=node_modules /package.json /package.json
COPY --from=node_modules /package-lock.json /package-lock.json
ENV PATH /node_modules/.bin:$PATH
# Copy project files
WORKDIR /usr/src/app
COPY . .
RUN cp .env.example .env
EXPOSE 2500 2501 2510