-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (53 loc) · 1.95 KB
/
Dockerfile
File metadata and controls
69 lines (53 loc) · 1.95 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
69
FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04
# Set noninteractive mode for apt
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
# Make sure we have a good apt environment
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
# Add deadsnakes PPA for Python (more reliable)
RUN add-apt-repository ppa:deadsnakes/ppa
# Install Python 3.10 and dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 \
python3.10-dev \
python3.10-distutils \
python3-pip \
build-essential \
git \
libopenmpi-dev \
zlib1g-dev \
swig \
&& rm -rf /var/lib/apt/lists/*
# Verify Python installation
RUN python3.10 --version
# Set Python 3.10 as default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \
update-alternatives --set python3 /usr/bin/python3.10 && \
update-alternatives --set python /usr/bin/python3.10
# Install pip properly
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
RUN python -m pip install --upgrade pip
# Verify Python and pip installation
RUN python --version && pip --version
# Set up working directory
WORKDIR /app
# Create cache directory
RUN mkdir -p /app/trading_bot/data/local_data
# Copy requirements first
COPY requirements.txt /app/
# Install PyTorch with CUDA support
RUN pip install --no-cache-dir torch==2.7.0+cu128 torchvision torchaudio \
--extra-index-url https://download.pytorch.org/whl/cu128
# Install remaining requirements
RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy the rest of the repository
COPY . .
# Create volume mount points
VOLUME ["/app/logs", "/app/trading_bot/data/local_data"]
# No entrypoint to allow docker-compose to provide the command
CMD ["python", "-m", "trading_bot.sac.zoo.train"]