Shardul Dhekane commited on
Commit
60fef21
·
1 Parent(s): 1908b01

Update Docker

Browse files
Files changed (1) hide show
  1. Dockerfile +48 -0
Dockerfile CHANGED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
8
+ curl \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copy requirements first for better caching
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy the rest of the application
16
+ COPY . .
17
+
18
+ # Create a wrapper script to handle API configuration
19
+ RUN echo '#!/bin/bash\n\
20
+ # Check if API configuration is provided\n\
21
+ if [ -z "$API_BASE_URL" ]; then\n\
22
+ echo " WARNING: API_BASE_URL not set!"\n\
23
+ echo " Please set the following environment variables:"\n\
24
+ echo " API_BASE_URL - Your API endpoint"\n\
25
+ echo " MODEL_NAME - Model identifier"\n\
26
+ echo " API_KEY - Your API key"\n\
27
+ echo ""\n\
28
+ echo "Examples:"\n\
29
+ echo " OpenAI: API_BASE_URL=https://api.openai.com/v1 MODEL_NAME=gpt-4"\n\
30
+ echo " Gemini: API_BASE_URL=https://generativelanguage.googleapis.com MODEL_NAME=gemini-1.5-pro"\n\
31
+ echo " Local: API_BASE_URL=http://localhost:11434/v1 MODEL_NAME=llama2"\n\
32
+ echo ""\n\
33
+ exit 1\n\
34
+ fi\n\
35
+ \n\
36
+ # Show current configuration\n\
37
+ echo "🔧 Running with configuration:"\n\
38
+ echo " API_BASE_URL: ${API_BASE_URL}"\n\
39
+ echo " MODEL_NAME: ${MODEL_NAME}"\n\
40
+ echo " TEMPERATURE: ${TEMPERATURE:-0.7}"\n\
41
+ echo " MAX_TOKENS: ${MAX_TOKENS:-2000}"\n\
42
+ echo ""\n\
43
+ \n\
44
+ # Run inference with provided configuration\n\
45
+ python inference.py "$@"' > /usr/local/bin/run-agent && chmod +x /usr/local/bin/run-agent
46
+
47
+ # Default command (will be overridden by docker run arguments)
48
+ CMD ["run-agent", "--task-id", "bug_detection_easy"]