File size: 777 Bytes
4ae2c8b 4648733 |
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 |
# Use the official Python image with version 3.9
FROM python:3.9
# Create a new user to run the application
RUN useradd -m -u 1000 user
# Set the user for subsequent commands
USER user
# Update the PATH environment variable
ENV PATH="/home/user/.local/bin:$PATH"
# Set the working directory
WORKDIR /app
# Copy the requirements.txt file into the container
COPY --chown=user ./requirements.txt requirements.txt
# Install the dependencies listed in requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the entire project into the container
COPY --chown=user . /app
# Expose the application port (7860) for Hugging Face Spaces
EXPOSE 7860
# Set the command to run the application using Flask-SocketIO and eventlet
CMD ["python", "app.py"]
|