shanto268 commited on
Commit
4d44ef6
·
verified ·
1 Parent(s): 430a968

v4 flagship Space (3 tiers) from registry v2 (earlier contents: 906bc45ae05c)

Browse files
Files changed (1) hide show
  1. 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 inside a Space (SYSTEM=spaces); at build time there is no
12
- # Space, so warm.py gets placeholder OAuth variables for this one step (the running Space uses HF's real ones).
13
- RUN SYSTEM=spaces SPACE_ID=build/warm OAUTH_CLIENT_ID=warm OAUTH_CLIENT_SECRET=warm OAUTH_SCOPES="openid profile" \
 
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"]