41 lines
739 B
Docker
41 lines
739 B
Docker
# Recipe Manager Frontend Dockerfile
|
|
# Multi-stage build for production
|
|
|
|
# Stage 1: Build
|
|
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
|
|
# Copy source code and config files
|
|
COPY tsconfig.json ./
|
|
COPY vite.config.ts ./
|
|
COPY postcss.config.js ./
|
|
COPY tailwind.config.js ./
|
|
COPY index.html ./
|
|
COPY public ./public
|
|
COPY src ./src
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve with nginx
|
|
FROM nginx:alpine
|
|
|
|
# Copy built assets from builder stage
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Copy nginx configuration
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Start nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|