-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 1017 Bytes
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 1017 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
FROM node:20-alpine AS builder
ARG VITE_API_URL="http://172.17.0.1:8000"
ARG APP_DIR=/opt/app
RUN mkdir -p ${APP_DIR}
COPY ./ ${APP_DIR}/
ENV VITE_API_URL=${VITE_API_URL}
WORKDIR ${APP_DIR}
RUN yarn install && yarn run build
FROM alpine AS source
ARG DHPARAM_DIR=/var/srv/dhparam.cert
RUN apk update && \
apk add --update --no-cache -f curl git openssl libressl && \
git clone https://github.com/jaysnm/nginx-errors.git /opt/share && \
mkdir -p ${DHPARAM_DIR} && \
openssl dhparam -dsaparam -out ${DHPARAM_DIR}/dhparams.pem 4096
FROM nginx:alpine AS runner
ARG ERROR_PAGES=/usr/share/nginx/error-pages
ARG APP_DIR=/opt/app
ARG APP_HOME=/opt/www
ARG DHPARAM_DIR=/var/srv/dhparam.cert
RUN mkdir -p ${APP_HOME} ${ERROR_PAGES} ${DHPARAM_DIR}
WORKDIR ${APP_HOME}
COPY --from=builder ${APP_DIR}/dist ${APP_HOME}
COPY --from=source /opt/share ${ERROR_PAGES}
COPY --from=source ${DHPARAM_DIR}/dhparams.pem ${DHPARAM_DIR}/dhparams.pem
COPY ./nginx/security.conf ./nginx/ssl-options.conf /etc/nginx/