forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ai-evals
More file actions
60 lines (50 loc) · 1.62 KB
/
Dockerfile.ai-evals
File metadata and controls
60 lines (50 loc) · 1.62 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Same as pyproject.toml so that uv can pick it up and doesn't need to download a different Python version.
FROM python:3.12.12-slim-bookworm AS python-base
FROM ghcr.io/astral-sh/uv:0.10.2 AS uv
FROM cruizba/ubuntu-dind:latest
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
# Copy Python base and uv
COPY --from=python-base /usr/local /usr/local
COPY --from=uv /uv /uvx /bin/
# Set working directory
WORKDIR /code
# uv settings for Docker builds
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
ENV UV_PROJECT_ENVIRONMENT=/python-runtime
# Copy Docker scripts
COPY docker/ ./docker/
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
"build-essential" \
"git" \
"libpq-dev" \
"libxmlsec1" \
"libxmlsec1-dev" \
"libffi-dev" \
"zlib1g-dev" \
"pkg-config" \
"netcat-openbsd" \
"postgresql-client" \
&& \
rm -rf /var/lib/apt/lists/*
# Install Python dependencies using cache mount for faster rebuilds
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project --no-binary-package lxml --no-binary-package xmlsec
# Copy project files
COPY bin/ ./bin/
COPY manage.py manage.py
COPY common/esbuilder common/esbuilder
COPY common/hogvm common/hogvm/
COPY posthog posthog/
COPY products/ products/
COPY ee ee/
COPY docker-compose.base.yml docker-compose.dev.yml ./
ENV PATH=/python-runtime/bin:$PATH \
PYTHONPATH=/python-runtime
# Make scripts executable
RUN chmod +x bin/*
CMD bin/docker-ai-evals