crop-prediction-api / Dockerfile
Dharine's picture
Update Dockerfile
411a251 verified
raw
history blame contribute delete
476 Bytes
# Use Python 3.11 for compatibility
FROM python:3.11
# Add a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Copy requirements and install
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the application
COPY --chown=user . /app
# Expose port for HF Spaces
EXPOSE 7860
# Start the app
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]