Hakathon2 / Dockerfile.test
Nanny7's picture
Add health check and improve Dockerfile
6a5c577
raw
history blame contribute delete
554 Bytes
FROM python:3.11
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 --upgrade -r requirements.txt
# Copy application code
COPY ./src ./src
# Expose port
EXPOSE 7860
# Health check
HEALTHCHECK CMD curl -f http://localhost:7860/health || exit 1
# Run the application
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "info"]