26 lines
592 B
Docker
26 lines
592 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy requirements and install Python dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY src/ ./src/
|
|
|
|
# Expose port
|
|
EXPOSE 8006
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
CMD curl -f http://localhost:8006/health || exit 1
|
|
|
|
# Start the application
|
|
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8006"]
|