CoolFace
Apppublic

Tresor26/Coffee-beans-classification

sourceHugging Facemitupdated 2mo agoView on Hugging Face
1likes
Dockerfile43 linesDownload Raw Back to root
1FROM python:3.12-slim2 3ENV PYTHONUNBUFFERED=1 \4    TF_CPP_MIN_LOG_LEVEL=2 \5    API_BASE=http://127.0.0.1:8000 \6    HOME=/app \7    STREAMLIT_SERVER_FILE_WATCHER_TYPE=none8 9WORKDIR /app10 11RUN apt-get update && apt-get install -y --no-install-recommends \12        nginx libgl1 libglib2.0-0 \13    && rm -rf /var/lib/apt/lists/*14 15COPY requirements.txt .16RUN pip install --no-cache-dir -r requirements.txt17 18COPY src/ ./src/19COPY api/ ./api/20COPY ui/ ./ui/21COPY scripts/ ./scripts/22COPY models/ ./models/23COPY data/ ./data/24COPY docker/nginx.space.conf ./docker/nginx.space.conf25COPY docker/start.sh ./docker/start.sh26 27# Arm the promotion gate at build time, not on every boot. Scoring the baseline28# against the 400-image eval slice takes minutes on a Space's 2 vCPU, and doing29# it in start.sh means nginx does not bind :7860 until it finishes — the Space30# sits on "Starting" with nothing to show. Baking data/app.db into the image31# also means a restart on ephemeral storage comes back with a registered32# champion instead of an empty registry, where the gate would compare every33# candidate against 0.0 and promote it regardless of quality.34# No `|| true` on purpose: an unarmed gate should fail the build, not ship.35RUN python scripts/register_baseline.py36 37RUN chmod +x docker/start.sh \38    && mkdir -p /app/data/pending /var/lib/nginx /var/log/nginx \39    && chmod -R 777 /app/data /var/lib/nginx /var/log/nginx40 41EXPOSE 786042CMD ["./docker/start.sh"]43