-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (53 loc) · 1.61 KB
/
Dockerfile
File metadata and controls
68 lines (53 loc) · 1.61 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Repuragent Docker Container
FROM python:3.13-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive \
JAVA_HOME=/usr/lib/jvm/default-java
# Install system dependencies including Java 11
RUN apt-get update && apt-get install -y \
# Java 11 for CPSign
default-jdk \
# Build tools and system utilities
build-essential \
gcc \
g++ \
git \
curl \
wget \
unzip \
# For some Python packages that might need compilation
python3-dev \
# Clean up
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Verify Java installation
RUN java -version
# Set working directory
WORKDIR /app
# Create necessary directories
RUN mkdir -p /app/data /app/results /app/models /app/temp
# Copy requirements first for better caching
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Pre-fetch Chroma default embedding model to avoid runtime download delays
RUN python - <<'PY'
from chromadb.utils.embedding_functions import DefaultEmbeddingFunction
embedder = DefaultEmbeddingFunction()
embedder(["warmup"]) # triggers model download & caching
print("Chroma default embedding model cached during build.")
PY
# Copy the entire application
COPY . .
# Set proper permissions
RUN chmod +x models/CPSign/cpsign-2.0.0-fatjar.jar 2>/dev/null || true
RUN chmod -R 755 /app
RUN chown -R $USER:$USER /app
# Create volumes for persistent data and memory stores
VOLUME ["/app/data", "/app/results", "/app/backend/memory"]
# Expose Gradio port
EXPOSE 7860
# Default command
USER $USER
CMD ["python", "main.py"]