-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (26 loc) · 1.09 KB
/
Copy pathDockerfile
File metadata and controls
34 lines (26 loc) · 1.09 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
FROM python:3.12-slim AS base
LABEL org.opencontainers.image.title="AgentCourt" \
org.opencontainers.image.description="Policy-driven dispute resolution API for AI agent commerce" \
org.opencontainers.image.source="https://github.com/vbkotecha/agentcourt-api" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="1.4.0"
WORKDIR /app
# Install all dependencies from requirements.txt
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy source
COPY src/ ./src/
COPY sdk/ ./sdk/
COPY sdk-python/ ./sdk-python/
COPY mcp-server/ ./mcp-server/
COPY tests/ ./tests/
# Run as non-root user
RUN useradd -m -u 1000 agentcourt && chown -R agentcourt:agentcourt /app
USER agentcourt
# Expose port
EXPOSE 8000
# Healthcheck
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:${PORT:-8000}/health').read()" || exit 1
# Run — Railway provides $PORT
CMD ["sh", "-c", "python3 -m uvicorn src.main:app --host 0.0.0.0 --port ${PORT:-8000}"]