-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (36 loc) · 1.56 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (36 loc) · 1.56 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
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
# Installer Python 3.11 à partir du PPA de deadsnakes
RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \
software-properties-common wget ffmpeg libsndfile-dev && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3.11 python3.11-venv python3.11-distutils python3.11-dev && \
# Mettre python3 par défaut sur 3.11
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 && \
# Installer pip pour Python 3.11
wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py && \
python3.11 /tmp/get-pip.py && \
rm /tmp/get-pip.py && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Turn off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Configure Poetry
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
# Install Poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==1.8.3
# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
# Now we can install the project's Python dependencies using Poetry
WORKDIR /workspace
# COPY pyproject.toml poetry.lock ./
COPY pyproject.toml ./
RUN poetry install --no-root
# Copy the project code and run a script
COPY ./ ./
CMD poetry run python ./__init__.py