File size: 1,187 Bytes
0594db3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
# GODSEED — break-glass Dockerfile.
#
# INERT BY NAME: the Space ships as sdk:gradio (required for the ZeroGPU upgrade
# path) and Hugging Face only honors a file literally named "Dockerfile". If the
# gradio health-check ever refuses app.py, flip the Space to sdk:docker and:
#
#   git mv Dockerfile.fallback Dockerfile
#
# README YAML then needs: sdk: docker / app_port: 7860 (drop app_file).

FROM python:3.12-slim

# build-essential + cmake: llama-cpp-python compiles from source on this image.
RUN apt-get update \
    && apt-get install -y --no-install-recommends build-essential cmake git curl \
    && rm -rf /var/lib/apt/lists/*

# Spaces run containers as uid 1000 with a writable home.
RUN useradd -m -u 1000 user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    HF_HOME=/home/user/.cache/huggingface \
    PORT=7860

WORKDIR /app

COPY --chown=user requirements.txt .
USER user
RUN pip install --no-cache-dir --user -r requirements.txt

COPY --chown=user . .

# traces/ must be writable for wishes.jsonl (dataset sync restores it on boot).
USER root
RUN mkdir -p /app/traces && chown -R user:user /app/traces
USER user

EXPOSE 7860
CMD ["python", "app.py"]