Skip to content

Commit b87a0bd

Browse files
committed
chore(template): align Docker/Compose defaults and improve docs safety
- unify container user/home defaults across Dockerfile and Compose - make PIP_DEFAULT_TIMEOUT configurable and consistent (build + runtime) - fix Poetry dev install flag to `--with dev` - normalize Compose entrypoints/args for codex login and jupyter ip - harden `.env.dist` secret placeholders to avoid key-like examples - improve README quickstart, rebuild guidance, and secret-safe config sharing - remove duplicated/outdated README closing text
1 parent c9cb40d commit b87a0bd

4 files changed

Lines changed: 29 additions & 27 deletions

File tree

.env.dist

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ POETRY_OPTIONS_APP="--only main --compile"
2020
POETRY_OPTIONS_DEV="--no-root --with dev --compile"
2121
POETRY_NO_INTERACTION=1
2222

23-
JUPYTER_TOKEN=_change_me_please_!1_
24-
OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxx"
25-
GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
23+
# Secrets: keep in local .env only; never paste them into logs/issues.
24+
JUPYTER_TOKEN=change_me_to_a_strong_random_token
25+
OPENAI_API_KEY=
26+
GEMINI_API_KEY=

Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ FROM archlinux:base-devel AS python-base
22
ARG TZ=Asia/Vladivostok
33
ARG DOCKER_HOST_UID=1000
44
ARG DOCKER_HOST_GID=1000
5-
ARG DOCKER_USER=devuser
6-
ARG DOCKER_USER_HOME=/home/devuser
5+
ARG DOCKER_USER=developer
6+
ARG DOCKER_USER_HOME=/home/developer
77
ARG MIRROR_LIST_COUNTRY=RU
88
ARG BUILD_PACKAGES="pyenv git gnupg sudo postgresql-libs mariadb-libs openmp"
99
ARG PYTHON_VERSION=3.14
10+
ARG PIP_DEFAULT_TIMEOUT=300
1011
ARG POETRY_VERSION=2.3.2
1112
RUN echo "* soft core 0" >> /etc/security/limits.conf && \
1213
echo "* hard core 0" >> /etc/security/limits.conf && \
@@ -50,7 +51,7 @@ RUN pyenv install --skip-existing $PYTHON_VERSION && \
5051
pyenv rehash && \
5152
rm -rf "$PYENV_ROOT/cache" "$PYENV_ROOT/sources" /tmp/python-build*
5253
ENV PYTHONUNBUFFERED=1
53-
ENV PIP_DEFAULT_TIMEOUT=100
54+
ENV PIP_DEFAULT_TIMEOUT=$PIP_DEFAULT_TIMEOUT
5455
ENV POETRY_NO_INTERACTION=1
5556
ENV POETRY_HOME=/opt/poetry
5657
ENV POETRY_CACHE_DIR=/var/cache/pypoetry
@@ -69,7 +70,7 @@ ENV PYTHON_VERSION=$PYTHON_VERSION
6970
FROM python-base AS poetry
7071
ARG DOCKER_HOST_UID=1000
7172
ARG DOCKER_HOST_GID=1000
72-
ARG DOCKER_USER=devuser
73+
ARG DOCKER_USER=developer
7374
RUN mkdir -p $POETRY_CACHE_DIR && \
7475
chown -R $DOCKER_USER $POETRY_CACHE_DIR
7576
RUN mkdir -p $PIP_CACHE_DIR && \
@@ -80,7 +81,7 @@ WORKDIR /application
8081
FROM python-base AS app-build
8182
ARG DOCKER_HOST_UID=1000
8283
ARG DOCKER_HOST_GID=1000
83-
ARG DOCKER_USER=devuser
84+
ARG DOCKER_USER=developer
8485
COPY src/ build/src
8586
COPY README.md /build/
8687
COPY pyproject.toml poetry.lock /build/
@@ -92,9 +93,9 @@ USER ${DOCKER_HOST_UID}:${DOCKER_HOST_GID}
9293
WORKDIR /application
9394

9495
FROM python-base AS build-deps-dev
95-
ARG DOCKER_USER=devuser
96+
ARG DOCKER_USER=developer
9697
ARG VIM_PACKAGES="python vim vim-spell-en vim-spell-ru ctags ripgrep bat npm nodejs-lts-jod openai-codex gemini-cli"
97-
ARG POETRY_OPTIONS_DEV="--no-root --with-dev --compile"
98+
ARG POETRY_OPTIONS_DEV="--no-root --with dev --compile"
9899
RUN pacman -Sy --noconfirm && \
99100
pacman -S --noconfirm --needed $VIM_PACKAGES && \
100101
pacman -Scc --noconfirm && \
@@ -116,16 +117,16 @@ RUN mkdir -p $DOCKER_USER_HOME/.local/share/jupyter && \
116117
FROM build-deps-dev AS dev-build
117118
ARG DOCKER_HOST_UID=1000
118119
ARG DOCKER_HOST_GID=1000
119-
ARG DOCKER_USER=devuser
120+
ARG DOCKER_USER=developer
120121
USER ${DOCKER_HOST_UID}:${DOCKER_HOST_GID}
121122
WORKDIR /application
122123
RUN git config --global --add safe.directory /application
123124

124125
FROM build-deps-dev AS vim-ide
125126
ARG DOCKER_HOST_UID=1000
126127
ARG DOCKER_HOST_GID=1000
127-
ARG DOCKER_USER=devuser
128-
ARG DOCKER_USER_HOME=/home/devuser
128+
ARG DOCKER_USER=developer
129+
ARG DOCKER_USER_HOME=/home/developer
129130
USER ${DOCKER_HOST_UID}:${DOCKER_HOST_GID}
130131
RUN curl -fLo $DOCKER_USER_HOME/.vim/autoload/plug.vim --create-dirs \
131132
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ Use it as-is or tailor it to match your team's development workflow.
8989

9090
```bash
9191
cp .env.dist .env
92+
cp .vimrc.dist .vimrc
93+
cp .coc-settings.json.dist .coc-settings.json
9294
docker compose build vim-ide
9395
docker compose run --rm vim-ide
9496
```
@@ -165,7 +167,9 @@ docker compose run --rm poetry lock
165167
```
166168

167169
> 🔄 Note: If you've changed dependencies (e.g. updated pyproject.toml or
168-
> poetry.lock), you must rebuild the Vim IDE image to apply them:
170+
> poetry.lock), rebuild the image(s) that install Python dependencies:
171+
> `vim-ide`, `dev`, `codex`, `gemini`, `jupyterlab`, and/or `app` depending on
172+
> what you run.
169173
170174
```bash
171175
docker compose build vim-ide
@@ -356,6 +360,9 @@ docker compose run --rm codex suggest tests --file src/sample/main.py
356360
Never commit `.env` (it contains secrets like `OPENAI_API_KEY`,
357361
`GEMINI_API_KEY`, and `JUPYTER_TOKEN`).
358362

363+
If you need to share the resolved Compose config, use
364+
`docker compose config --no-interpolate` to avoid printing secret values.
365+
359366
Browser-based auth persists under `${DOCKER_USER_HOME}/.codex` and
360367
`${DOCKER_USER_HOME}/.gemini` via the `codex-auth` and `gemini-auth` Docker
361368
volumes.
@@ -437,13 +444,3 @@ productivity and designed to work out of the box — but is fully customizable.
437444
* To update CoC extensions: `:CocUpdate`
438445
* Snippets can be edited under `~/.vim/plugged/vim-snippets`
439446
* Full configuration lives in `.vimrc.dist` — tweak freely
440-
441-
This is a template for python-based projects. Many DS/ML workflows require
442-
hardware-specific platforms in detailed OS-level libraries and python
443-
dependencies. In some cases, it is useful to perform code editing in the same
444-
environment in which applications are run. This template can help vim users to
445-
run vim-ide with the same project environment on a local or remote machine.
446-
Please, feel free to massage everything in the template as you wish.
447-
448-
Vim is configured in a modern style and supports almost all ide-specific
449-
features. Please see `.vimrc.dist` for reference.

compose.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
x-default-env: &default-env
22
POETRY_NO_INTERACTION: "1"
3-
PIP_DEFAULT_TIMEOUT: "600"
3+
PIP_DEFAULT_TIMEOUT: "${PIP_DEFAULT_TIMEOUT:-300}"
44
PYTHONUNBUFFERED: "1"
55

66
x-platform: &platform ${DOCKER_PLATFORM:-linux/amd64}
@@ -15,6 +15,7 @@ x-default-args: &default-args
1515
BUILD_PACKAGES: ${BUILD_PACKAGES:-pyenv git gnupg sudo postgresql-libs mariadb-libs openmp}
1616
VIM_PACKAGES: ${VIM_PACKAGES:-python vim vim-spell-en vim-spell-ru ctags ripgrep bat npm nodejs-lts-jod openai-codex gemini-cli}
1717
PYTHON_VERSION: ${PYTHON_VERSION:-3.14}
18+
PIP_DEFAULT_TIMEOUT: ${PIP_DEFAULT_TIMEOUT:-300}
1819
POETRY_VERSION: ${POETRY_VERSION:-2.3.2}
1920
POETRY_OPTIONS_APP: ${POETRY_OPTIONS_APP:---only main --compile}
2021
POETRY_OPTIONS_DEV: ${POETRY_OPTIONS_DEV:---no-root --with dev --compile}
@@ -102,7 +103,9 @@ services:
102103
target: ${DOCKER_USER_HOME}/.codex
103104
codex-web-login:
104105
platform: *platform
105-
entrypoint: codex login
106+
entrypoint:
107+
- codex
108+
- login
106109
build:
107110
target: dev-build
108111
args: *default-args
@@ -119,7 +122,7 @@ services:
119122
entrypoint:
120123
- jupyter-lab
121124
- --port=8888
122-
- --ip="0.0.0.0"
125+
- --ip=0.0.0.0
123126
- --no-browser
124127
- --IdentityProvider.token=${JUPYTER_TOKEN}
125128
ports:

0 commit comments

Comments
 (0)