-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathDockerfile.api
More file actions
16 lines (15 loc) · 761 Bytes
/
Copy pathDockerfile.api
File metadata and controls
16 lines (15 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
FROM python:3.12-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends build-essential git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY . .
RUN pip wheel --no-cache-dir --wheel-dir /wheels .
FROM python:3.12-slim AS runtime
RUN useradd --create-home --uid 10001 agentwatch
COPY --from=builder /wheels /wheels
RUN pip install --no-cache-dir /wheels/*.whl && rm -rf /wheels
USER agentwatch
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import urllib.request, sys; sys.excepthook = lambda *a: sys.exit(1); urllib.request.urlopen('http://localhost:8000/health', timeout=5)" || exit 1
CMD ["uvicorn", "agentwatch.api.server:app", "--host", "0.0.0.0", "--port", "8000"]