File size: 1,017 Bytes
6f95f2a
 
 
 
cfda61e
4ec75cf
6f95f2a
 
4ec75cf
 
 
 
 
 
cfda61e
 
 
9bb611a
4ec75cf
 
 
6f95f2a
 
 
4ec75cf
 
 
 
 
 
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
# Stage 1: Build dependencies
FROM python:3.10-slim AS builder
WORKDIR /build
COPY pyproject.toml .
RUN pip install --no-cache-dir . || pip install --no-cache-dir fastapi uvicorn pydantic openai requests packaging gradio python-dotenv

# Stage 2: Runtime
FROM python:3.10-slim
LABEL org.opencontainers.image.title="multi-agent-dev-tools-env"
LABEL org.opencontainers.image.description="Multi-Agent Dev Tools RL Environment"
LABEL openenv="true"

WORKDIR /app

# Copy installed packages AND scripts (uvicorn binary) from builder
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin

# Copy project files
COPY . .

# Results directory
RUN mkdir -p results && chmod 777 results

EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/')" || exit 1

CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]