forked from quarkusio/quarkus-super-heroes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (24 loc) · 844 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
# First stage builds the application
FROM registry.access.redhat.com/ubi8/nodejs-16:1 as builder
# Add dependencies
COPY --chown=1001:1001 package*.json $HOME
# Install dependencies
RUN npm install
# Add application sources
COPY --chown=1001:1001 . $HOME
# Run build
RUN npm run build && \
npm prune --production
# Second stage copies the application to the minimal image
FROM registry.access.redhat.com/ubi8/nodejs-16-minimal:1
# ENV variables
# API_BASE_URL: URL of service to connect to
# HTTP_PORT: The http port this service listens on
ENV HTTP_PORT=8080 \
NODE_ENV=production
# Copy the application source and build artifacts from the builder image to this one
COPY --chown=1001:1001 --from=builder $HOME $HOME
# Expose the http port
EXPOSE $HTTP_PORT
# Run script uses standard ways to run the application
CMD npm start