-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
32 lines (20 loc) · 949 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
FROM node:20-alpine as build
WORKDIR /usr/src/app
COPY package*.json .
COPY . .
RUN apk upgrade --update && apk --no-cache add git
RUN NODE_OPTIONS="--openssl-legacy-provider"
RUN NODE_OPTIONS="--max-old-space-size=4096" npm set progress=false
RUN NODE_OPTIONS="--max-old-space-size=4096" npm ci --legacy-peer-deps
RUN NODE_OPTIONS="--openssl-legacy-provider" npm run build --verbose
# Final Stage
FROM nginx:1.27.1-alpine3.20-slim AS fnl_base_image
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
COPY --from=build /usr/src/app/configure/inject.template.js /usr/share/nginx/html/inject.template.js
COPY --from=build /usr/src/app/configure/nginx.conf /etc/nginx/conf.d/configfile.template
COPY --from=build /usr/src/app/configure/entrypoint.sh /
ENV PORT 80
ENV HOST 0.0.0.0
RUN sh -c "envsubst '\$PORT' < /etc/nginx/conf.d/configfile.template > /etc/nginx/conf.d/default.conf"
EXPOSE 80
ENTRYPOINT [ "sh", "/entrypoint.sh" ]