-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.api
More file actions
39 lines (29 loc) · 1.11 KB
/
Dockerfile.api
File metadata and controls
39 lines (29 loc) · 1.11 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
FROM python:3.13-slim
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install dependencies first for better layer caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY api/ api/
COPY config/ config/
COPY mcp_server/ mcp_server/
# Copy .claude subdirectories if they exist (agents for system prompts, templates for output formats)
COPY .claude/ .claude/
COPY knowledge/ knowledge/
COPY alembic.ini* ./
COPY alembic/ alembic/
COPY pyproject.toml* ./
COPY run_worker.py .
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
# Create writable directories before switching to non-root user
RUN mkdir -p logs /data/db /data/output /data/transcripts
# Run as non-root user for security
RUN useradd --create-home appuser && chown -R appuser:appuser logs config /data
USER appuser
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/system/health')" || exit 1
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]