godseed / Dockerfile.fallback
AndresCarreon's picture
GODSEED v0
0594db3 verified
Raw
History Blame Contribute Delete
1.19 kB
# 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"]