Spaces:
Sleeping
Sleeping
File size: 625 Bytes
74c31b0 ed57925 74c31b0 ed57925 74c31b0 ed57925 74c31b0 ed57925 74c31b0 ed57925 74c31b0 ed57925 74c31b0 ed57925 74c31b0 | 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 an official Python runtime as a parent image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
FLASK_APP=app.py \
HOME=/home/user
# Create a non-root user
RUN useradd -m -u 1000 user
USER user
WORKDIR $HOME/app
# Copy requirements and install
COPY --chown=user requirement.txt .
RUN pip install --no-cache-dir --user -r requirement.txt
# Add user bin to path
ENV PATH="/home/user/.local/bin:${PATH}"
# Copy the rest of the application
COPY --chown=user . .
# Hugging Face Spaces required port
EXPOSE 7860
# Launch the app
CMD ["python", "app.py"]
|