-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (31 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
46 lines (31 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
45
46
# First, build the application in the `/app` directory.
# See `Dockerfile` for details.
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
ARG OPENHOUND_VERSION
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${OPENHOUND_VERSION}
# Omit development dependencies
ENV UV_NO_DEV=1
# Disable Python downloads, because we want to use the system interpreter
# across both images.
ENV UV_PYTHON_DOWNLOADS=0
WORKDIR /app
COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --extra all --frozen
FROM gcr.io/distroless/python3:nonroot AS base
# Set the python path + additional Python runtime config
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH="/app/src:/app/.venv/lib/python3.13/site-packages"
COPY --from=builder --chown=nonroot:nonroot /app /app
WORKDIR /app
# Create an image that exposes the CLI as default
FROM base AS cli
ENTRYPOINT ["python", "-m", "openhound"]
CMD ["--help"]
# Create an image that runs the scheduler by default
FROM base AS enterprise
ENTRYPOINT ["python", "src/scheduler.py"]