17 lines
667 B
Docker
17 lines
667 B
Docker
# Build stage: Vite -> static dist/. GIT_SHA is passed by the build-push action.
|
|
FROM node:22.23.4-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
ARG GIT_SHA=dev
|
|
ENV VITE_GIT_SHA=${GIT_SHA}
|
|
RUN npx vite build
|
|
|
|
# Runtime stage: static files only, no Node. Runs as uid 101, listens on 8080.
|
|
FROM nginxinc/nginx-unprivileged:1.31.7-alpine
|
|
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
COPY --chmod=0755 docker-entrypoint.d/10-config.sh /docker-entrypoint.d/10-config.sh
|
|
# html dir owned by nginx so 10-config.sh can write config.js at start.
|
|
COPY --from=build --chown=101:101 /app/dist /usr/share/nginx/html
|
|
EXPOSE 8080
|