v4 flagship Space (3 tiers) from registry v2 (earlier contents: 906bc45ae05c)
Browse files- Dockerfile +5 -4
Dockerfile
CHANGED
|
@@ -2,14 +2,15 @@
|
|
| 2 |
FROM python:3.12-slim
|
| 3 |
RUN useradd -m -u 1000 user
|
| 4 |
USER user
|
| 5 |
-
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH NUMBA_CPU_NAME=generic NUMBA_CACHE_DIR=/home/user/app/numba_cache \
|
| 6 |
GRADIO_SERVER_NAME=0.0.0.0 PORT=7860 PYTHONUNBUFFERED=1
|
| 7 |
WORKDIR /home/user/app
|
| 8 |
COPY --chown=user requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir --user -r requirements.txt "gradio==6.29.1"
|
| 10 |
COPY --chown=user . .
|
| 11 |
-
# OAuth Spaces (hf_oauth): Gradio builds real login routes only
|
| 12 |
-
#
|
| 13 |
-
|
|
|
|
| 14 |
OPENID_PROVIDER_URL=https://huggingface.co TLSQ_NUM_THREADS=2 python warm.py
|
| 15 |
CMD ["python", "app.py"]
|
|
|
|
| 2 |
FROM python:3.12-slim
|
| 3 |
RUN useradd -m -u 1000 user
|
| 4 |
USER user
|
| 5 |
+
ENV SYSTEM=spaces HOME=/home/user PATH=/home/user/.local/bin:$PATH NUMBA_CPU_NAME=generic NUMBA_CACHE_DIR=/home/user/app/numba_cache \
|
| 6 |
GRADIO_SERVER_NAME=0.0.0.0 PORT=7860 PYTHONUNBUFFERED=1
|
| 7 |
WORKDIR /home/user/app
|
| 8 |
COPY --chown=user requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir --user -r requirements.txt "gradio==6.29.1"
|
| 10 |
COPY --chown=user . .
|
| 11 |
+
# OAuth Spaces (hf_oauth): Gradio builds real login routes only when SYSTEM=spaces (set above: HF does not set it in Docker
|
| 12 |
+
# Spaces, but it does pass SPACE_ID and the OAUTH_* variables at run time). At build time those are absent, so warm.py gets
|
| 13 |
+
# placeholders for this one step.
|
| 14 |
+
RUN SPACE_ID=build/warm OAUTH_CLIENT_ID=warm OAUTH_CLIENT_SECRET=warm OAUTH_SCOPES="openid profile" \
|
| 15 |
OPENID_PROVIDER_URL=https://huggingface.co TLSQ_NUM_THREADS=2 python warm.py
|
| 16 |
CMD ["python", "app.py"]
|