Spaces:
Running
Running
File size: 902 Bytes
085a012 1027cfb 085a012 1027cfb 085a012 1027cfb 085a012 1027cfb 085a012 |
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 34 |
FROM python:3.10-slim
# Install git for cloning results repository
RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
rm -rf /var/lib/apt/lists/*
# The two following lines are requirements for the Dev Mode to be functional
# Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
RUN useradd -m -u 1000 user
WORKDIR /app
# Copy dependencies manifest
COPY --chown=user requirements.txt requirements.txt
# Install dependencies (no secrets needed)
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy in your Gradio app code
COPY . .
RUN mkdir -p /home/user/data && chown -R user:user /home/user/data
# Make the app treat this as non‑debug (so DATA_DIR=/home/user/data)
ENV system=spaces
# (5) Switch to a non-root user
USER user
# (6) Expose Gradio’s default port
EXPOSE 7860
# (7) Launch your app
CMD ["python", "app.py"]
|