35 lines
838 B
Docker
35 lines
838 B
Docker
# ============================================================
|
|
# Panacea Storefront — Frontend Dockerfile
|
|
# Multi-stage: Node 22 build → Nginx alpine runtime
|
|
# ============================================================
|
|
|
|
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files and install dependencies
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
# Copy store frontend source files
|
|
COPY . ./
|
|
|
|
ARG VITE_API_BASE=""
|
|
ENV VITE_API_BASE=${VITE_API_BASE}
|
|
ARG VITE_BASE_PATH="/store/"
|
|
ENV VITE_BASE_PATH=${VITE_BASE_PATH}
|
|
|
|
RUN npm run build
|
|
|
|
FROM nginx:1.27-alpine AS runtime
|
|
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
RUN ln -sf /usr/share/nginx/html /usr/share/nginx/html/store
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|