Skip to content

Commit 95c41c0

Browse files
committed
Update python and poetry, split dev deps
- update pythov version to 3.14 - update poetry to 2.2.1 - move dev deps to separate group and image slice
1 parent 57d8183 commit 95c41c0

8 files changed

Lines changed: 3598 additions & 52 deletions

File tree

.env.dist

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ MIRROR_LIST_COUNTRY=RU
1111
BUILD_PACKAGES="pyenv git gnupg sudo postgresql-libs mariadb-libs openmp"
1212
VIM_PACKAGES="python vim ctags ripgrep bat npm nodejs-lts-jod"
1313

14-
PYTHON_VERSION=3.13
14+
PYTHON_VERSION=3.14
1515
PYTHONUNBUFFERED=1
1616
PIP_DEFAULT_TIMEOUT=100
17-
POETRY_VERSION=2.1.3
18-
POETRY_OPTIONS="--no-root --compile"
17+
POETRY_VERSION=2.2.1
18+
POETRY_OPTIONS_APP="--only main --compile"
19+
POETRY_OPTIONS_DEV="--no-root --with dev --compile"
1920
POETRY_NO_INTERACTION=1
2021

2122
JUPYTER_TOKEN=_change_me_please_!1_

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
.env
44
.vimrc
55

6+
# jupyter
7+
.ipynb_checkpoints/
8+
69
# Byte-compiled / optimized / DLL files
710
__pycache__/
811
*.py[cod]

Dockerfile

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ ARG DOCKER_USER=devuser
66
ARG DOCKER_USER_HOME=/home/devuser
77
ARG MIRROR_LIST_COUNTRY=RU
88
ARG BUILD_PACKAGES="pyenv git gnupg sudo postgresql-libs mariadb-libs openmp"
9-
ARG PYTHON_VERSION=3.13
10-
ARG POETRY_VERSION=2.1.3
9+
ARG PYTHON_VERSION=3.14
10+
ARG POETRY_VERSION=2.2.1
1111
RUN echo "* soft core 0" >> /etc/security/limits.conf && \
1212
echo "* hard core 0" >> /etc/security/limits.conf && \
1313
echo "* soft nofile 10000" >> /etc/security/limits.conf
@@ -22,8 +22,7 @@ RUN mkdir /application && chown $DOCKER_USER:$DOCKER_USER /application
2222
RUN curl -s \
2323
"https://archlinux.org/mirrorlist/?country=$MIRROR_LIST_COUNTRY&protocol=http&protocol=https&ip_version=4" \
2424
| sed -e 's/^#Server/Server/' -e '/^#/d' > /etc/pacman.d/mirrorlist
25-
RUN pacman -Syu --noconfirm
26-
RUN pacman -S --noconfirm $BUILD_PACKAGES
25+
RUN pacman -Syu --noconfirm && pacman -S --noconfirm $BUILD_PACKAGES
2726
RUN echo "${DOCKER_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
2827
ENV PYENV_ROOT=$DOCKER_USER_HOME/.pyenv
2928
ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
@@ -54,23 +53,30 @@ RUN mkdir -p $PIP_CACHE_DIR && \
5453
USER $DOCKER_USER
5554
WORKDIR /application
5655

57-
FROM python-base AS build-deps
58-
ARG POETRY_OPTIONS="--no-root --compile"
59-
COPY pyproject.toml poetry.lock /build/
60-
RUN poetry install $POETRY_OPTIONS -n -v -C /build && \
61-
rm -rf $POETRY_CACHE_DIR/* && rm -rf $PIP_CACHE_DIR/*
62-
63-
FROM build-deps AS app-build
56+
FROM python-base AS app-build
6457
ARG DOCKER_USER=devuser
6558
COPY src/ build/src
6659
COPY README.md /build/
67-
RUN poetry install -C /build
60+
COPY pyproject.toml poetry.lock /build/
61+
ARG POETRY_OPTIONS_APP="--only main --compile"
62+
RUN poetry install $POETRY_OPTIONS_APP -n -v -C /build && \
63+
rm -rf $POETRY_CACHE_DIR/* && rm -rf $PIP_CACHE_DIR/*
6864
RUN sed -i "/\b\($DOCKER_USER\)\b/d" /etc/sudoers
6965
RUN pacman -Scc <<< Y <<< Y
7066
USER $DOCKER_USER
7167
WORKDIR /application
7268

73-
FROM build-deps AS vim-ide
69+
FROM python-base AS build-deps-dev
70+
ARG POETRY_OPTIONS_DEV="--no-root --with-dev --compile"
71+
COPY pyproject.toml poetry.lock /build/
72+
RUN poetry install $POETRY_OPTIONS_DEV -n -v -C /build
73+
74+
FROM build-deps-dev AS dev-build
75+
ARG DOCKER_USER=devuser
76+
USER $DOCKER_USER
77+
WORKDIR /application
78+
79+
FROM build-deps-dev AS vim-ide
7480
ARG DOCKER_USER=devuser
7581
ARG DOCKER_USER_HOME=/home/devuser
7682
ARG VIM_PACKAGES="python vim ctags ripgrep bat npm nodejs-lts-jod"

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* [🧪 Tested with](#-tested-with)
1010
* [🚀 Getting Started](#-getting-started)
1111
* [🧠 Vim IDE Features](#-vim-ide-features)
12-
* [🔌Included Plugins](#included-plugins)
13-
* [🗂 Additional Notes](#-additional-notes)
12+
* [🔌Included Plugins](#included-plugins)
13+
* [🗂 Additional Notes](#-additional-notes)
1414

1515
<!-- vim-markdown-toc -->
1616

@@ -50,9 +50,9 @@ Use it as-is or tailor it to match your team's development workflow.
5050

5151
## 🧪 Tested with
5252

53-
- **Docker**: `27.3.1``28.2.2`
54-
- **buildx**: `0.20.0``0.25.0`
55-
- **Compose**: `2.32.1``2.37.1`
53+
- **Docker**: `27.3.1``29.1.1`
54+
- **buildx**: `0.20.0``0.30.0`
55+
- **Compose**: `2.32.1``2.40.3`
5656

5757
## 🚀 Getting Started
5858

@@ -68,8 +68,8 @@ vim .env # Set OS packages, Python version, Poetry version, etc.
6868
```bash
6969
vim pyproject.toml # Edit dependencies, metadata, etc.
7070
docker compose build poetry
71-
docker compose run --rm poetry lock # Generate poetry.lock
72-
git add poetry.lock
71+
docker compose run --rm poetry lock # Generate or update poetry.lock
72+
# git add poetry.lock
7373
```
7474

7575
3. Build your Vim IDE image

compose.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@ services:
1414
- VIM_PACKAGES=${VIM_PACKAGES}
1515
- PYTHON_VERSION=${PYTHON_VERSION}
1616
- POETRY_VERSION=${POETRY_VERSION}
17-
- POETRY_OPTIONS=${POETRY_OPTIONS}
17+
- POETRY_OPTIONS_APP=${POETRY_OPTIONS_APP}
18+
- POETRY_OPTIONS_DEV=${POETRY_OPTIONS_DEV}
1819
environment: &default-env
1920
- POETRY_NO_INTERACTION=1
2021
- PIP_DEFAULT_TIMEOUT=100
2122
- PYTHONUNBUFFERED=1
22-
volumes:
23-
- type: bind
24-
source: .
25-
target: /application
2623
poetry:
2724
platform: linux/amd64
2825
entrypoint: poetry
@@ -51,13 +48,6 @@ services:
5148
- type: bind
5249
source: .
5350
target: /application
54-
app:
55-
platform: linux/amd64
56-
entrypoint: template_bin
57-
build:
58-
target: app-build
59-
args: *default-args
60-
environment: *default-env
6151
jupyterlab:
6252
platform: linux/amd64
6353
entrypoint:
@@ -69,13 +59,20 @@ services:
6959
ports:
7060
- "8888:8888"
7161
build:
72-
target: app-build
62+
target: dev-build
7363
args: *default-args
7464
environment: *default-env
7565
volumes:
7666
- type: bind
7767
source: .
7868
target: /application
69+
app:
70+
platform: linux/amd64
71+
entrypoint: template_bin
72+
build:
73+
target: app-build
74+
args: *default-args
75+
environment: *default-env
7976
volumes:
8077
pip-cache:
8178
driver: local

0 commit comments

Comments
 (0)