Spaces:
Paused
Paused
File size: 798 Bytes
6ff8367 ab8dd72 6ff8367 4af3521 ab8dd72 6ff8367 4af3521 ab8dd72 257bb1c c8b84e3 398c82c b522915 6ff8367 bf08545 ab8dd72 c5240cd bf08545 f94bded c5240cd ab8dd72 4af3521 ab8dd72 3b9f761 |
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 31 32 33 |
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"]
|