-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.train
More file actions
31 lines (20 loc) · 794 Bytes
/
Dockerfile.train
File metadata and controls
31 lines (20 loc) · 794 Bytes
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
FROM python:3.11-slim-bookworm AS builder
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
gcc g++ libgomp1 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --upgrade pip \
&& pip install --no-cache-dir \
torch==2.2.0 --index-url https://download.pytorch.org/whl/cpu \
&& pip install --no-cache-dir -r requirements.txt
# ── runtime ──
FROM python:3.11-slim-bookworm AS train
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.11 /usr/local/lib/python3.11
COPY --from=builder /usr/local/bin /usr/local/bin
COPY . .
RUN python data_prep.py --scenario all
ENV CONFIG=configs/qlearning_v1.yaml
ENV MLFLOW_TRACKING_URI=http://mlflow:5000
CMD ["sh", "-c", "python train.py --config ${CONFIG}"]