DeutschLernen/german-app-frontend/Dockerfile
Lasse Rune Hansen 79a59bccc4 feat(backend/infra): add Docker configuration for Phase 3
- Create Dockerfile for backend (.NET 9.0 multi-stage build)
- Create Dockerfile for frontend (Node + Nginx multi-stage build)
- Create nginx.conf for frontend with API proxy
- Create docker-compose.yml with db, backend, frontend services
- Add .dockerignore files for backend, frontend, and root
- Configure health checks for all services
- Configure PostgreSQL volume for persistent data

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 11:46:27 +02:00

43 lines
1,005 B
Docker

# GermanApp Frontend Dockerfile
# React 19 + TypeScript + Vite Application
# Multi-stage build for production optimization
# ============================================
# 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
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
# Entry point (nginx runs by default)
CMD ["nginx", "-g", "daemon off;"]