-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 821 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (21 loc) · 821 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
# ---------- Base ----------
FROM node:24-alpine AS builder
# Required for @parcel/watcher
RUN apk add --update g++ make python3 && rm -rf /var/cache/apk/*
WORKDIR /usr/local/app
# Copy the source files
COPY ./ /usr/local/app/
# Install all dependencies, both production and development, build, and remove dev dependencies
RUN npm ci && \
npm run build:prod && \
npm prune --omit=dev
# ---------- Release ----------
FROM nginx:1.31.1-alpine-slim
# Copy nginx config file
RUN rm -rf /usr/share/nginx/html/* && rm -rf /etc/nginx/nginx.conf
COPY nginx.conf nginx-no-ssl.conf nginx-ssl.conf /etc/nginx/
# Copy dynamic env setup script
COPY ./docker/setup.sh /setup.sh
RUN chmod +x /setup.sh
# Copy the production dependencies
COPY --from=builder /usr/local/app/dist/switcher-management/browser /usr/share/nginx/html