Rednote / frontend /Dockerfile.frontend
orakzai-io
Initial
194aaa5
Raw History Blame Contribute Delete
922 Bytes
# ── Build stage ─────────────────────────────────────────────────────
FROM node:22-alpine AS builder
ARG VITE_API_URL=/api
ENV VITE_API_URL=$VITE_API_URL
WORKDIR /app
# Copy dependency manifests and install
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
# Copy source code and build
COPY frontend/ ./
RUN npm run build
# ── Production stage ────────────────────────────────────────────────
FROM nginx:alpine
# Copy the built assets from the builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy the custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]