Skip to content

Commit

Permalink
Update poetry dependency management
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodiegoss committed Oct 28, 2024
1 parent 489fd17 commit 28fa6fc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
30 changes: 14 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@

FROM python:3.13.0-slim-bookworm
FROM python:3.13.0-slim-bookworm as base-image

RUN apt-get update && \
apt-get install -y --no-install-recommends \
gettext \
docutils-common \
curl \
pipx \
wget

COPY ./pyproject.toml /pyproject.toml
COPY ./poetry.lock /poetry.lock
gettext \
docutils-common \
curl \
wget


ENV PATH="$PATH:/root/.local/bin" \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
TINI_VERSION=v0.19.0 \
# poetry:
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=true \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
POETRY_VERSION=1.8.4


# Installing `poetry` package manager:
# https://github.com/python-poetry/poetry
RUN pip install --upgrade pip
RUN pipx install --python python3 poetry==${POETRY_VERSION}
RUN poetry install

RUN curl -sSL https://install.python-poetry.org | python3 -

RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}" -O /usr/local/bin/tini \
Expand All @@ -36,6 +31,9 @@ RUN mkdir -p /jandig/src /jandig/locale /jandig/docs /jandig/static /jandig/buil

WORKDIR /jandig

COPY ./pyproject.toml /jandig/pyproject.toml
COPY ./poetry.lock /jandig/poetry.lock

COPY ./src/ /jandig/src/
COPY ./docs/ /jandig/docs/
COPY ./locale/ /jandig/locale/
Expand Down
13 changes: 4 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ services:
ports:
- 8000:8000
volumes:
- ./src/:/jandig/src/
- ./docs/:/jandig/docs/
- ./etc/:/jandig/etc/
- ./locale/:/jandig/locale/
- ./run.sh:/jandig/run.sh
- ./tasks.py:/jandig/tasks.py
- ./poetry.lock:/poetry.lock
- ./pyproject.toml:/pyproject.toml
- ./:/jandig
- poetry_cache:/var/cache/pypoetry
env_file:
- .envs/.example
depends_on:
Expand Down Expand Up @@ -90,4 +84,5 @@ services:
volumes:
postgres_data:
media_data:
mailpit_data:
mailpit_data:
poetry_cache:
1 change: 1 addition & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
poetry install
poetry show
poetry run inv collect db i18n --compile docs run -g

0 comments on commit 28fa6fc

Please sign in to comment.