-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDockerfile
33 lines (27 loc) · 978 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
# ----------------------------------------------------------------------
# Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
# The Universal Permissive License (UPL), Version 1.0
# ----------------------------------------------------------------------
###############################
# Build stage (node/npm) #
###############################
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14-alpine as builder
RUN npm config set loglevel warn \
&& npm set progress=false
# install dependencies
COPY package*.json /tmp/
RUN cd /tmp && npm ci
RUN mkdir -p /src && cp -a /tmp/node_modules /src
RUN rm -rf /tmp/node_modules
# copy source and build
WORKDIR /src
COPY . .
RUN npm prune --production
############################
# Runtime container (node) #
############################
FROM --platform=${TARGETPLATFORM:-linux/amd64} node:14-alpine
COPY --from=builder /src /app
WORKDIR /app
# entrypoint
ENTRYPOINT [ "node", "wrapper.js" ]