-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
52 lines (37 loc) · 1.28 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 build for FlowCheck MCP server
# Stage 1: Builder - compile dependencies
FROM python:3.13-slim as builder
WORKDIR /app
# Copy project files
COPY pyproject.toml .
COPY src/ ./src/
# Install build dependencies and package
RUN pip install --user --no-cache-dir -e .
# Stage 2: Runtime - minimal production image
FROM python:3.13-slim
WORKDIR /app
# Create non-root user for security
RUN groupadd -r flowcheck && useradd -r -g flowcheck flowcheck
# Install git (required by GitPython)
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy dependencies from builder
COPY --from=builder /root/.local /home/flowcheck/.local
# Copy application code
COPY --from=builder /app/src ./src
# Set environment
ENV PATH=/home/flowcheck/.local/bin:$PATH \
PYTHONUNBUFFERED=1 \
FLOWCHECK_LOG_LEVEL=INFO
# Create data directory with proper permissions
RUN mkdir -p /data/flowcheck && chown -R flowcheck:flowcheck /data/flowcheck
# Switch to non-root user
USER flowcheck
# Health check - check if process is running
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD ps aux | grep -q '[f]lowcheck-server' || exit 1
# Expose MCP server port
EXPOSE 8000
# Run MCP server
CMD ["flowcheck-server"]