generated from tu-studio/hpc-cluster-ml-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (40 loc) · 1.25 KB
/
Dockerfile
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
# Use an official Debian runtime as a parent image
FROM debian:11-slim
# Install necessary packages
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
build-essential \
libssl-dev \
zlib1g-dev \
libncurses5-dev \
libgdbm-dev \
libreadline-dev \
libffi-dev \
libsqlite3-dev \
curl \
libbz2-dev \
git \
python3-pip \
openssh-client \
rsync \
# Remove apt cache
&& rm -rf /var/lib/apt/lists/*
# Install Python Version 3.12.4
RUN wget --no-check-certificate https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz \
&& tar -xf Python-3.12.4.tgz \
&& cd Python-3.12.4 \
&& ./configure --enable-optimizations \
&& make -j$(nproc) \
&& make altinstall \
&& cd .. \
# Delete the unzipped directory and downloaded archive to save space
&& rm -rf Python-3.12.4 Python-3.12.4.tgz \
# Create symlink for python3
&& ln -s /usr/local/bin/python3.12 /usr/local/bin/python3 \
&& ln -s /usr/local/bin/python3.12 /usr/local/bin/python
# Set the working directory
WORKDIR /home/app
# Copy the python requirements list to /home/app and install them
COPY requirements.txt .
RUN python3 -m pip install -r requirements.txt \
&& rm requirements.txt