-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (45 loc) · 1.31 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (45 loc) · 1.31 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
61
62
# Multi-stage Dockerfile for both API and CLI
FROM python:3.13-slim AS base
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Set working directory
WORKDIR /workspace
# Copy workspace configuration and member pyproject.toml files
COPY pyproject.toml ./
COPY api/pyproject.toml api/
COPY cli/pyproject.toml cli/
# API stage
FROM base AS api
# Copy source files for both workspace members (needed for dependency resolution)
COPY api/src api/src/
COPY cli/src cli/src/
# Install dependencies from workspace root
RUN uv sync --no-dev
# Expose API port
EXPOSE 8000
# Run API
CMD ["uv", "run", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
# CLI stage
FROM base AS cli
# Copy source files for both workspace members (needed for dependency resolution)
COPY api/src api/src/
COPY cli/src cli/src/
# Install dependencies from workspace root
RUN uv sync --no-dev
# Set entrypoint to CLI
ENTRYPOINT ["uv", "run", "platform-cli"]
CMD ["--help"]
# Development stage with all tools
FROM base AS dev
# Install system dependencies for development
RUN apt-get update && apt-get install -y \
git \
make \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy all project files
COPY . .
# Install all dependencies (including dev)
RUN uv sync
# Default command for development
CMD ["/bin/bash"]