Spaces:
Sleeping
Sleeping
File size: 586 Bytes
d6dc12b 365133f d6dc12b b5f99f6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # Starting from an official Python image
FROM python:3.9
# Creating a non-root user for security
RUN useradd -m -u 1000 user
USER user
# Ensuring user's local bin is on PATH
ENV PATH="/home/user/.local/bin:$PATH"
# Setting working directory inside container
WORKDIR /app
# Installing Python dependencies
COPY --chown=user ./req.txt req.txt
RUN pip install --no-cache-dir --upgrade -r req.txt
# Copying the rest of your app code
COPY --chown=user . /app
# Starting the Flask app using gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "rm:app","--timeout","120","--workers","1"]
|