-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
60 lines (41 loc) · 852 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Base
#
FROM node:lts-alpine AS base
WORKDIR /opt/volt
COPY *.json ./
#
# Builder
#
FROM base AS builder
# Copy the source code
COPY src ./src
# install node packages
RUN npm set progress=false && npm config set depth 0 && \
npm config set unsafe-perm=true
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
# build
RUN npm run build
#
# Test
#
FROM builder AS test
COPY tests ./tests
# run tests
RUN npm run test
#
# Production image
#
FROM base as production
ENV NODE_ENV=production
# Default Workspace Volume
VOLUME [ "/data" ]
COPY --from=builder /opt/volt/dist/ dist/
RUN npm install -g --loglevel verbose
# Secrets Port
EXPOSE 13000
CMD ["volt", "-l", "/data", "--secretsHost", "0.0.0.0"]