File size: 716 Bytes
e0a433a e2c0d52 e0a433a e2c0d52 e0a433a e2c0d52 e0a433a e2c0d52 e0a433a e2c0d52 e0a433a e2c0d52 d8e197c e2c0d52 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
# Use official Python image
FROM python:3.9
# Create a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Copy and install dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy all project files
COPY --chown=user . /app
# Set environment variables for Flask
ENV FLASK_APP=app.py
ENV PYTHONPATH=/app/src:$PYTHONPATH
# Expose the Flask port
EXPOSE 7860
# Run Flask
CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"] |