-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (38 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
52 lines (38 loc) · 1.22 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
# Multi-stage Dockerfile for peaky-peek-server
# Stage 1: Build frontend
FROM node:20-alpine AS frontend-builder
WORKDIR /frontend
# Copy frontend package files
COPY frontend/package.json frontend/package-lock.json* ./
# Install dependencies
RUN npm ci
# Copy frontend source and build
COPY frontend/ ./
RUN npm run build
# Stage 2: Runtime image
FROM python:3.12-slim
WORKDIR /app
# Copy package definition
COPY pyproject-server.toml ./
# Copy built frontend from stage 1
COPY --from=frontend-builder /frontend/dist ./frontend/dist
# Copy SDK and server source
COPY agent_debugger_sdk/ ./agent_debugger_sdk/
COPY api/ ./api/
COPY auth/ ./auth/
COPY collector/ ./collector/
COPY redaction/ ./redaction/
COPY storage/ ./storage/
# Install the package
RUN pip install --no-cache-dir -e .
# Create traces directory for data persistence
RUN mkdir -p /app/traces && \
adduser --disabled-password --gecos '' appuser
USER appuser
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health').read()" || exit 1
# Default command
CMD ["peaky-peek", "--host", "0.0.0.0", "--port", "8000"]