-
Notifications
You must be signed in to change notification settings - Fork 175
/
Dockerfile
47 lines (33 loc) · 976 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
#
# BUILD stage
#
FROM node:16 AS build
WORKDIR /usr/src/app
# Install and cache dependencies
COPY package.json package-lock.json ./
RUN npm ci
# Copy sources (see .dockerignore)
COPY . ./
# Build and test
RUN npm run build
# Prune dev dependencies from node_modules
RUN npm prune --production
#
# RUNTIME stage
# We pick last node 16.x to get recommended security updates. Any 16.x node should work as runtime.
#
FROM gcr.io/distroless/nodejs:16 as runtime
WORKDIR /app
# Example configuration and packages.json
COPY --from=build /usr/src/app/config-examples.yaml /usr/src/app/package.json /usr/src/app/package-lock.json ./
# Wikiticker dataset
COPY --from=build /usr/src/app/assets ./assets
# Main JS
COPY --from=build /usr/src/app/bin ./bin
# Build results
COPY --from=build /usr/src/app/build ./build
# Dependencies
COPY --from=build /usr/src/app/node_modules ./node_modules
# Expose default port
EXPOSE 9090
ENTRYPOINT [ "/nodejs/bin/node", "bin/turnilo" ]