-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
46 lines (34 loc) · 1.27 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
# NEAR Catalyst Framework - Multi-Agent Partnership Discovery System
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better Docker layer caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY . .
# Create necessary directories
RUN mkdir -p /app/data
# Set up benchmark configuration (copy example if main file doesn't exist)
RUN if [ ! -f "config/partnership_benchmarks.json" ]; then \
cp config/partnership_benchmarks.example.json config/partnership_benchmarks.json; \
fi
# Create a non-root user for security
RUN useradd -m -u 1000 catalyst && \
chown -R catalyst:catalyst /app
USER catalyst
# Expose the Flask server port
EXPOSE 5000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:5000/api/health', timeout=5)" || exit 1
# Default command runs the Flask server
CMD ["python", "server.py", "--host", "0.0.0.0", "--port", "5000"]