tugaa commited on
Commit
a5946de
·
verified ·
1 Parent(s): cf4231d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile for Agent Worker / Learning Worker (adjust base image for GPU if needed)
2
+
3
+ # Use a base image with Python and potentially CUDA for GPU support (for learning worker)
4
+ # FROM python:3.10-slim
5
+ FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 # Example GPU base image
6
+
7
+ WORKDIR /app
8
+
9
+ # Install system dependencies (e.g., for psycopg2, git)
10
+ # RUN apt-get update && apt-get install -y --no-install-recommends gcc libpq-dev git && rm -rf /var/lib/apt/lists/*
11
+
12
+ COPY requirements.txt .
13
+ # Install Python dependencies (consider using a virtual environment)
14
+ # Ensure torch is installed correctly for CPU/GPU
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+ # OR specific torch version:
17
+ # RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
18
+ # RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ COPY . .
21
+
22
+ # Set environment variables (can also be done via docker-compose.yml)
23
+ ENV OPENAI_API_KEY=your_openai_key
24
+ ENV POSTGRES_DSN=postgresql://user:password@postgres:5432/agentdb # Use service name 'postgres'
25
+ ENV REDIS_URL=redis://redis:6379/0 # Use service name 'redis'
26
+ ENV BASE_MODEL_NAME=gpt-4o-mini
27
+ # Add other ENV vars as needed (NUM_WORKERS, etc.)
28
+
29
+ # Command to run the worker (or learning script)
30
+ # CMD ["python", "your_main_script.py"]
31
+ # Use different CMD for agent worker vs learning worker containers if separated