-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (37 loc) · 1.38 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
45
FROM radixai/python-gpu:3.11-cuda11.8 as dependencies
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=on \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=10 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_NO_INTERACTION=1 \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
VENV_PATH="/opt/pysetup/.venv" \
PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" \
POETRY_VERSION=1.6.1
WORKDIR /opt
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
libcurl4 \
libcurl4-openssl-dev \
libssl-dev \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& update-ca-certificates --fresh
COPY pyproject.toml poetry.lock ./
RUN pip install --no-compile --no-cache-dir -U pip poetry==${POETRY_VERSION} \
&& ln -sf /etc/ssl/certs/ca-certificates.crt $(python -m certifi 2>&1 | grep cacert.pem) \
&& poetry install --only main \
&& ln -sf /etc/ssl/certs/ca-certificates.crt $(poetry run python -m certifi 2>&1 | grep cacert.pem) \
&& rm -rf ~/.cache/pypoetry \
&& find /opt -type f -name "*.py[co]" -delete -or -type d -name "__pycache__" -delete
FROM dependencies as development
RUN poetry install \
&& rm -rf ~/.cache/pypoetry \
&& find /opt -type f -name "*.py[co]" -delete -or -type d -name "__pycache__" -delete
COPY src ./src