sprite / Dockerfile
Cnass's picture
Upload 15 files
d708e6c verified
Raw History Blame Contribute Delete
1.34 kB
# Pixel Art Sprite Dataset Builder -- Hugging Face Space (Docker SDK)
#
# CPU-only, matches the spec's 8 vCPU / 32GB RAM hardware tier. No GPU
# base image, no CUDA -- everything here runs on numpy/scipy/Pillow.
FROM python:3.11-slim
WORKDIR /app
# System deps: Pillow needs a small set of image libs to build/run wheels
# cleanly on slim images.
RUN apt-get update && apt-get install -y --no-install-recommends \
libjpeg62-turbo \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Data directories are created here for a fresh container; if a
# persistent Space storage volume is mounted at /app/data, this becomes
# a no-op (mkdir -p won't clobber existing content).
RUN mkdir -p data/staging data/accepted data/rejected data/db
# Hugging Face Spaces expect the app to listen on $PORT (defaults to
# 7860 if unset, matching the Space's default exposed port).
ENV PORT=7860
EXPOSE 7860
# 2 workers is enough for a single-operator review workflow. Increase
# --workers if multiple people will review concurrently; SQLite's WAL
# mode (see database.py) handles light concurrent access fine, but very
# high write concurrency would want swapping to Postgres.
CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:${PORT} --workers 2 --timeout 120 app:app"]