- nginx:alpine doesn't have wget installed - Health check was causing container to stay in 'starting' state Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
40 lines
886 B
Docker
40 lines
886 B
Docker
# GermanApp Frontend Dockerfile
|
|
# React 19 + TypeScript + Vite Application
|
|
# Multi-stage build for production optimization
|
|
# Build context: german-app-frontend directory
|
|
|
|
# ============================================
|
|
# Build Stage
|
|
# ============================================
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
|
|
# Copy source files
|
|
COPY . .
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# ============================================
|
|
# Runtime Stage
|
|
# ============================================
|
|
FROM nginx:alpine AS runtime
|
|
WORKDIR /usr/share/nginx/html
|
|
|
|
# Copy built files from build stage
|
|
COPY --from=build /app/dist .
|
|
|
|
# Copy nginx configuration
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Entry point (nginx runs by default)
|
|
CMD ["nginx", "-g", "daemon off;"]
|