-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
58 lines (50 loc) · 1.36 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
53
54
55
56
57
58
FROM ubuntu:20.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 \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1 \
VENV_PATH="/opt/.venv"
ENV PATH="/opt/poetry/bin:$VENV_PATH/bin:$PATH"
# Install python 3.8
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
gcc \
ffmpeg \
libsm6 \
libxext6 \
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 -
RUN python3.8 -m pip install --upgrade pip
# install poetry dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install
# Copy source code to the image
COPY . ./landmark-detection
ENV PYTHONPATH=/opt/landmark-detection/src:$PYTHONPATH