Config is volume-mounted in docker-compose, making the COPY unnecessary and causing build failures when config/ is gitignored. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
26 lines
557 B
Docker
26 lines
557 B
Docker
# Use official Python runtime as base image
|
|
FROM python:3.11-slim
|
|
|
|
# Set working directory in container
|
|
WORKDIR /app
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
# Install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY src/ ./src/
|
|
|
|
# Create non-root user for security
|
|
RUN useradd -m -u 1000 appuser && \
|
|
chown -R appuser:appuser /app
|
|
|
|
USER appuser
|
|
|
|
# Run the application
|
|
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]
|