40 lines
745 B
Docker
40 lines
745 B
Docker
# ==========================================
|
|
# dashboard/Dockerfile (Production)
|
|
# ==========================================
|
|
FROM node:lts-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
COPY pnpm-lock.yaml* ./
|
|
|
|
# Install pnpm and dependencies
|
|
RUN npm install -g pnpm
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build arguments
|
|
ARG NODE_ENV=production
|
|
ARG VITE_API_URL
|
|
|
|
# Build the application
|
|
RUN pnpm build
|
|
|
|
# Production stage with nginx
|
|
FROM nginx:alpine
|
|
|
|
# Copy built files to nginx
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Copy custom nginx config (optional)
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Start nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|