forked from comfy-deploy/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
57 lines (41 loc) · 1.65 KB
/
Dockerfile.test
File metadata and controls
57 lines (41 loc) · 1.65 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
FROM python:3.12-slim-bullseye
COPY --from=ghcr.io/astral-sh/uv:0.4.30 /uv /bin/uv
FROM python:3.12-slim-bullseye
# The installer requires curl (and certificates) to download the release archive
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates unzip
# Download the latest installer
ADD https://astral.sh/uv/0.4.30/install.sh /uv-installer.sh
# Install Bun
RUN curl -fsSL https://bun.sh/install | bash
# Add Bun to PATH
ENV PATH="/root/.bun/bin:$PATH"
# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh
# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.cargo/bin/:$PATH"
WORKDIR /app
# Copy Python dependency files first (for better caching)
COPY pyproject.toml /app/
COPY uv.lock /app/
COPY requirements-test.txt /app/
COPY README.md /app/
# Sync Python dependencies - this layer will be cached unless dependency files change
RUN uv sync --dev --no-install-project
# Copy Node.js dependency files
COPY package.json /app/
# Install Node.js dependencies - this layer will be cached unless package.json changes
RUN bun install
# Copy migration scripts (these change less frequently)
COPY migrate.mts /app/
# COPY migrate-clickhouse.mts /app/
# Copy source code and tests last (these change most frequently)
COPY src/ /app/src/
# Install the current project in editable mode
RUN uv pip install -e .
COPY tests/ /app/tests/
# Use the virtual environment automatically
ENV VIRTUAL_ENV=/app/.venv
# Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH"
# Presuming there is a `my_app` command provided by the project
CMD ["uv", "run", "src/api/server.py"]