23 lines
456 B
Docker
23 lines
456 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy requirements first for better caching
|
|
COPY requirements.txt .
|
|
|
|
# Install dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application and documentation
|
|
COPY main.py .
|
|
COPY docs/ ./docs/
|
|
|
|
# Build documentation during image build
|
|
RUN mkdocs build -f docs/mkdocs.yml -d site
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Run the application
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|