opencand.ui/OpenCand.UI.dockerfile
2025-05-31 11:33:47 -03:00

28 lines
965 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ─── Stage 1: Build ───────────────────────────────────────────────────────
FROM node:slim AS builder
WORKDIR /app
# Install dependencies
COPY package.json package-lock.json ./
RUN yarn install --frozen-lockfile
COPY . .
ARG VITE_API_BASE_URL
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
RUN yarn build
# ─── Stage 2: Serve ────────────────────────────────────────────────────────
FROM nginx:stable-alpine
# Remove default nginx html
RUN rm -rf /usr/share/nginx/html/*
# Copy our built files into nginxs html folder
COPY --from=builder /app/dist /usr/share/nginx/html
# (Optional) If you need any custom nginx.conf, COPY it here—
# e.g. COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]