-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (20 loc) · 746 Bytes
/
Dockerfile
File metadata and controls
23 lines (20 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# build stage
FROM node:lts-alpine AS build-stage
WORKDIR /
COPY package*.json ./
COPY .snyk ./
RUN mkdir -p public
RUN npm install
COPY . .
RUN npm run build
RUN node tools/generate-health.js
# production stage
FROM openresty/openresty:1.27.1.2-5-bookworm AS production-stage
RUN apt-get update && apt-get install -y gettext-base # required to use envsubst
COPY --from=build-stage /dist /usr/share/nginx/html
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf.template
# Default configuration
ENV PORT 80
ENV HEALTH_HTTP_PORT 8080
ENV SERVER_NAME _
CMD ["sh", "-c", "envsubst '${PORT},${HEALTH_HTTP_PORT},${SERVER_NAME}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && /usr/bin/openresty -g 'daemon off;'"]