Spaces:
Paused
Paused
| FROM docker.io/library/python:3.10-slim@sha256:80619a5316afae7045a3c13371b0ee670f39bac46ea1ed35081d2bf91d6c3dbd | |
| # Create a group and user | |
| RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy the application files | |
| COPY . . | |
| RUN mkdir -p /app/huggingface && chmod 777 /app/huggingface | |
| # Set the environment variable to point to the app directory | |
| ENV HF_HOME=/app/huggingface | |
| USER root | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Set ownership of the application directory | |
| RUN chown -R appuser:appgroup /app | |
| # Switch to the non-root user | |
| USER appuser | |
| # Expose the port | |
| EXPOSE 8000 | |
| # Run the application | |
| ENTRYPOINT ["gunicorn", "app:app"] | |
| CMD ["-b", "0.0.0.0:7860", "--workers=1"] | |