site/Dockerfile
2025-06-21 21:13:37 +02:00

32 lines
722 B
Docker

# Use the official Python image as a base
FROM python:3.11-slim AS builder
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file
COPY requirements.txt .
# Install MkDocs and any other dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire MkDocs project into the container
COPY . .
# Build the MkDocs project
RUN mkdocs build
# Use Nginx as the web server
FROM nginx:latest
# Copy the built MkDocs site from the builder stage
COPY --from=builder /app/site /usr/share/nginx/html
# Copy custom Nginx configuration file (if needed)
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]