-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 727 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 727 Bytes
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
# Stage.0 Build environment
FROM node:11.6.0-alpine as build
WORKDIR .
ENV PATH /node_modules/.bin:/usr/bin:/bin:$PATH
COPY . ./
COPY package.json ./
COPY package-lock.json ./
COPY scripts/dockerloadenv.sh /dockerloadenv.sh
# Install deps
RUN npm ci --silent
# build website
RUN npm run build
# Stage.1 Run
FROM nginx:1.19.10-alpine as run
# Copy production environment
COPY --from=build /build /usr/share/nginx/html
# Install jq, needed for dockerloadenv.sh
RUN apk update \
&& apk add jq \
&& rm -rf /var/cache/apk/*
EXPOSE 80
COPY scripts/dockerloadenv.sh /dockerloadenv.sh
# Expose docker env to website index.html & then launch nginx
ENTRYPOINT ["sh", "/dockerloadenv.sh"]
CMD ["nginx", "-g", "daemon off;"]