-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
52 lines (44 loc) · 1.32 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
46
47
48
49
50
51
52
FROM nvidia/cuda:11.0.3-devel-ubuntu20.04
# Set lang
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# Set python env vars
ENV PYTHONUNBUFFERED=1 \
# Prevents python creating .pyc files
PYTHONDONTWRITEBYTECODE=1 \
\
# Pip
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
\
# Poetry
# https://python-poetry.org/docs/configuration/#using-environment-variables
POETRY_VERSION=1.1.11 \
POETRY_NO_INTERACTION=1 \
POETRY_HOME=/opt/poetry \
PATH="/opt/poetry/bin:$PATH"
# Install python 3.8
ENV DEBIAN_FRONTEND=noninteractive
# Rotating Keys
RUN rm /etc/apt/sources.list.d/cuda.list
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
git-lfs \
ssh \
python3.8 \
python3.8-dev \
python3.8-venv \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# install poetry - respects $POETRY_VERSION & $POETRY_HOME
WORKDIR /opt
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3.8 -
# install poetry dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry config virtualenvs.create false && \
poetry install
# Copy source code to the image
COPY --chown=$USER_UID:$USER_GID . ./simulation
ENV PYTHONPATH=/opt/simulation/src:$PYTHONPATH