-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 1.17 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (32 loc) · 1.17 KB
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
41
42
43
44
# ---- Build stage ----
FROM python:3.12-slim AS builder
WORKDIR /app
# Install build deps
COPY pyproject.toml .
RUN pip install --no-cache-dir --prefix=/install .
# ---- Runtime stage ----
FROM python:3.12-slim
LABEL maintainer="locallmq"
LABEL description="Cloud-to-local LLM inference queue with resource-aware scheduling"
WORKDIR /app
# Copy installed packages from builder
COPY --from=builder /install /usr/local
# Copy application code
COPY src/ src/
# Create data directory for SQLite
RUN mkdir -p /data
# Environment defaults
ENV LOCALLMQ_DB_PATH=/data/locallmq.db \
LOCALLMQ_HOST=0.0.0.0 \
LOCALLMQ_PORT=8000 \
LOCALLMQ_OLLAMA_URL=http://ollama:11434 \
LOCALLMQ_DEFAULT_MODEL=qwen3:8b \
LOCALLMQ_MAX_QUEUE_SIZE=5 \
LOCALLMQ_JOB_TIMEOUT=300 \
LOCALLMQ_MEMORY_PRESSURE_THRESHOLD=80
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/v1/health')" || exit 1
# Single worker — critical for resource management
CMD ["python", "-m", "uvicorn", "locallmq.main:app", \
"--host", "0.0.0.0", "--port", "8000", "--workers", "1"]