-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (28 loc) · 1.12 KB
/
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
# ----------------------------------------------------------------------
# First stage, compile application
# ----------------------------------------------------------------------
FROM --platform=$BUILDPLATFORM node:14 AS builder
WORKDIR /usr/src/app
# specify which service to use
ARG INCORE_REMOTE_HOSTNAME=""
ENV INCORE_REMOTE_HOSTNAME=${INCORE_REMOTE_HOSTNAME}
# copy only package for caching purposes
COPY package*.json /usr/src/app/
COPY tools/ /usr/src/app/tools/
RUN npm install
# copy rest of application
COPY .babelrc .eslintrc .istanbul.yml *.js /usr/src/app/
COPY test /usr/src/app/test/
COPY src /usr/src/app/src/
# build application
RUN npm run build
# ----------------------------------------------------------------------
# Second stage, final image
# ----------------------------------------------------------------------
FROM nginx:alpine AS runtime
RUN apk add --no-cache jq
COPY --from=builder /usr/src/app/dist/ /usr/share/nginx/html/
COPY src/public /usr/share/nginx/html/public/
COPY src/config /usr/share/nginx/html/config/
COPY landing.conf /etc/nginx/conf.d/default.conf
WORKDIR /usr/share/nginx/html/tags