-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
48 lines (35 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
FROM python:3.10-bullseye as python-base
LABEL maintainer="TACC-ACI-WMA <[email protected]>"
ARG DEBIAN_FRONTEND=noninteractive
# https://python-poetry.org/docs/configuration/#using-environment-variables
ENV POETRY_VERSION=1.2.0 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1 \
PYSETUP_PATH="/opt/pysetup" \
VENV_PATH="/opt/pysetup/.venv"
# prepend poetry and venv to path
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
FROM python-base as builder-base
# install locales for en_us.utf-8
RUN apt-get update && apt-get install -y \
dialog \
apt-utils \
locales \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LC_ALL en_US.utf-8
ENV LANG en_US.utf-8
RUN pip3 install --upgrade pip setuptools wheel
# Install Poetry - respects $POETRY_VERSION & $POETRY_HOME
RUN curl -sSL https://install.python-poetry.org | python3 -
# copy project requirement files here to ensure they will be cached.
WORKDIR $PYSETUP_PATH
COPY pyproject.toml poetry.lock ./
# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally
RUN poetry install --no-dev
# `production` image is used for deployed runtime environments
FROM python-base as production
COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH
COPY . /docs
WORKDIR /docs