Spaces:
Running
Running
File size: 587 Bytes
0bb50ed 82670e9 0bb50ed 2595f74 82670e9 2beeac7 50f7d9a 82670e9 50f7d9a 82670e9 50f7d9a 0bb50ed 50f7d9a 82670e9 50f7d9a |
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 |
FROM python:3.9-slim
# Create a non-root user with UID 1000
RUN useradd -m -u 1000 user
# Set working directory
RUN mkdir templates
RUN mkdir static
WORKDIR /app
RUN mkdir -p /app/static/plots && chown -R user:user /app/static
# Copy dependencies and install
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the full app
COPY --chown=user . .
# Switch to non-root user
USER user
# Expose port Hugging Face expects
EXPOSE 7860
# Run Flask app using Gunicorn on port 7860
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|