-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (24 loc) · 902 Bytes
/
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
FROM python:3.11.4-slim as base
MAINTAINER JP Hanna "[email protected]"
WORKDIR /app/
COPY . /app/
FROM base as install-poetry
# Set env variables
ENV PIPX_BIN_DIR="/opt/pipx" \
POETRY_NO_INTERACTION=true \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_VIRTUALENVS_IN_PROJECT=false \
POETRY_CACHE_DIR="/opt/poetry" \
POETRY_VERSION=1.7.0 \
PATH="/root/.local/share/pipx/venvs/poetry/bin:$PATH"
ENV PATH="$POETRY_VIRTUALENVS_PATH/bin:$PIPX_BIN_DIR:$PATH"
# Install poetry
RUN pip install --upgrade pip \
&& pip install pipx \
&& pipx install poetry==$POETRY_VERSION
# Install python dependencies
RUN poetry install --no-root --no-ansi --no-interaction --only=main --no-directory
# Install application into container
ENV PYTHONPATH "$PYTHONPATH:/app/"
FROM install-poetry as install-dev
RUN poetry install --no-root --no-ansi --no-interaction --only=dev --no-directory