gohan-api-light / Dockerfile
tabito12345678910
Fix numpy dependency: specify exact versions and install order in Dockerfile
4478f12
raw
history blame contribute delete
762 Bytes
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies including git for rtdl installation
RUN apt-get update && apt-get install -y \
gcc \
g++ \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install numpy and pandas first to avoid dependency conflicts
RUN pip install --no-cache-dir numpy==1.24.3 pandas==2.0.3 scipy==1.11.1
# Install the rest of the requirements
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Expose port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860/status || exit 1
# Run the application
CMD ["python", "app.py"]