Fixed TemplateNotFound error by adding missing templates directory to the Docker image. Error: jinja2.exceptions.TemplateNotFound: index.html Cause: Dockerfile was not copying the templates/ directory into the container Fix: Added 'COPY templates/ ./templates/' to Dockerfile The web application requires templates/ directory for Jinja2 templates: - templates/base.html - templates/index.html - templates/items.html - templates/users.html - templates/llm.html 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
26 lines
507 B
Docker
26 lines
507 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 templates/ ./templates/
|
|
COPY static/ ./static/
|
|
COPY docs/ ./docs/
|
|
COPY mkdocs.yml .
|
|
|
|
# Build documentation during image build
|
|
RUN mkdocs build -d site
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Run the application
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|