29 lines
626 B
Docker
29 lines
626 B
Docker
# Use the official Python image as a base
|
|
FROM python:3.11-slim
|
|
|
|
# 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 to the Nginx HTML directory
|
|
COPY --from=0 /app/site /usr/share/nginx/html
|
|
|
|
# Expose the default Nginx port
|
|
EXPOSE 80
|
|
|
|
# Start Nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|