forked from votem/mongo-stream
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdockerfile
More file actions
31 lines (29 loc) · 737 Bytes
/
dockerfile
File metadata and controls
31 lines (29 loc) · 737 Bytes
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
#
# ---- Base Node ----
FROM alpine:3.7 AS base
# install node
RUN apk add --no-cache nodejs
# set working directory
WORKDIR /root/mongo-stream
# copy project file
COPY package.json .
#
# ---- Dependencies ----
FROM base AS dependencies
# install node_modules
RUN npm set progress=false && npm config set depth 0
RUN npm install --only=production
# copy production node_modules aside
RUN cp -R node_modules prod_node_modules
# install ALL node_modules, including 'devDependencies'
RUN npm install
#
# ---- Release ----
FROM base AS release
# copy production node_modules
COPY --from=dependencies /root/mongo-stream/prod_node_modules ./node_modules
# copy app sources
COPY . .
# expose port and define CMD
EXPOSE 3000
CMD npm run start