-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (30 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
35 lines (30 loc) · 1.08 KB
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
FROM node:20 AS base
WORKDIR /usr/src
COPY start-client/package.json ./
COPY start-client/yarn.lock ./
COPY start-client/setupJest.js ./
COPY start-client/.babelrc ./
COPY start-client/src/ ./src/
COPY start-client/dev/ ./dev/
COPY start-client/static/ ./static/
COPY start-client/webpack.common.js ./
COPY start-client/webpack.prod.js ./
COPY start-client/webpack.dev.js ./
COPY start-client/BuildVersion.json ./
RUN yarn install --frozen-lockfile
# Test stage - can be run with: docker build --target test -t initializr-web-test .
FROM base AS test
CMD ["yarn", "test"]
# Build stage - builds production assets
FROM base AS build
ENV GOOGLE_TAGMANAGER_ID="G-2778ZJCYZ4"
RUN yarn build
FROM nginx:1-alpine
# Copy the build artifacts from the build stage
COPY --from=build /usr/src/public /usr/share/nginx/html
# Copy the nginx configuration template
# nginx:alpine automatically runs envsubst on files in /etc/nginx/templates/
# and outputs them to /etc/nginx/conf.d/
COPY deploy/docker/initializr-web.conf.template /etc/nginx/templates/default.conf.template
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]