-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.train
More file actions
42 lines (31 loc) · 1.35 KB
/
Copy pathDockerfile.train
File metadata and controls
42 lines (31 loc) · 1.35 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
# Training Dockerfile - matches deployment environment exactly
# Uses Python 3.11 to ensure model compatibility with deployment
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
# Install system dependencies (same as deployment)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
gfortran \
libopenblas-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy requirements (same versions as deployment)
# Note: requirements.txt is in services/coordinate-api/
COPY services/coordinate-api/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Install additional dependencies for training (not needed for API)
RUN pip install --no-cache-dir python-dotenv supabase
# Copy ONLY the training scripts we need (not the entire scripts directory)
COPY scripts/pritzker/train_umap_model.py /app/train_umap_model.py
COPY scripts/pritzker/train_hdbscan_model.py /app/train_hdbscan_model.py
COPY scripts/pritzker/sync_market_data.py /app/sync_market_data.py
# Create models directory (will be mounted as volume, but create for safety)
RUN mkdir -p /app/models
# Set working directory
WORKDIR /app
# Default entrypoint (will be overridden by docker run command)
CMD ["python3", "--version"]