blitzkode / Dockerfile
neuralbroker's picture
Update clean backend-only project docs and eval
d7faa11 verified
Raw
History Blame Contribute Delete
1.26 kB
FROM python:3.11-slim AS runtime
# Install curl for container health checks and keep the image lean.
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home appuser
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY server.py .
# Create a zero-byte placeholder so Docker sees the expected mount path.
# At runtime this file is replaced by the volume-mounted blitzkode.gguf.
RUN touch /app/blitzkode.gguf \
&& chown -R appuser:appuser /app
ENV BLITZKODE_HOST=0.0.0.0 \
BLITZKODE_PORT=7860 \
BLITZKODE_MODEL_PATH=/app/blitzkode.gguf \
BLITZKODE_GPU_LAYERS=0 \
BLITZKODE_THREADS=4 \
BLITZKODE_THREADS_BATCH=4 \
BLITZKODE_PRELOAD_MODEL=true \
BLITZKODE_N_CTX=2048 \
BLITZKODE_BATCH=256 \
BLITZKODE_UBATCH=128 \
BLITZKODE_PROMPT_CACHE=true \
BLITZKODE_PROMPT_CACHE_BYTES=67108864
EXPOSE 7860
HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=3 \
CMD curl -sf http://localhost:7860/health \
|| python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" \
|| exit 1
USER appuser
CMD ["python", "server.py"]