-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
40 lines (31 loc) · 1.18 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
# ============================================================
# Demo App — Cloud Run CPU Service
# Serves the UI and proxies /analyze requests to the vLLM GPU service.
#
# nginx starts instantly on port 8080 (serves UI from filesystem),
# uvicorn loads in the background (~20-30s) and handles API calls.
# ============================================================
FROM python:3.12-slim
LABEL maintainer="Vector Institute AI Engineering"
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
nginx \
&& rm -rf /var/lib/apt/lists/*
# Install uv for fast dependency resolution
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Copy and install Python dependencies first (layer cache)
COPY pyproject.toml uv.lock* README.md* ./
RUN uv sync --no-dev --frozen 2>/dev/null || uv sync --no-dev
# Copy application code
COPY app/ app/
COPY nginx.conf entrypoint.sh ./
RUN chmod +x /app/entrypoint.sh
ENV TOKENIZERS_PARALLELISM=false
ENV PORT=8080
EXPOSE 8080
# Run as non-root
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser
# nginx serves the UI immediately; uvicorn loads in the background.
CMD ["/app/entrypoint.sh"]