Fix containerised restarts

This commit is contained in:
2026-03-01 17:27:48 +00:00
parent 4521755344
commit d22924f6aa
7 changed files with 122 additions and 19 deletions

56
Containerfile.dev Normal file
View File

@@ -0,0 +1,56 @@
FROM python:3.11-bookworm
ARG USER_ID=1000
ARG GROUP_ID=1000
ARG USER_NAME=dev
RUN apt-get update && apt-get install -y --no-install-recommends \
bash-completion \
build-essential \
cargo \
ca-certificates \
curl \
fd-find \
fzf \
git \
golang \
jq \
less \
libffi-dev \
libssl-dev \
make \
neovim \
nodejs \
npm \
procps \
ripgrep \
rsync \
rustc \
sqlite3 \
tar \
tmux \
unzip \
wget \
which \
zip && \
rm -rf /var/lib/apt/lists/* && \
ln -sf /usr/bin/fdfind /usr/local/bin/fd
RUN groupadd -g "${GROUP_ID}" "${USER_NAME}" 2>/dev/null || true && \
useradd -m -u "${USER_ID}" -g "${GROUP_ID}" -s /bin/bash "${USER_NAME}"
USER ${USER_NAME}
WORKDIR /home/${USER_NAME}
# Build a project virtualenv and preinstall dependencies.
COPY --chown=${USER_NAME}:${USER_NAME} requirements.txt /tmp/requirements.txt
RUN bash -lc 'set -e; \
python3.11 -m venv /home/${USER_NAME}/.venv/gia && \
/home/${USER_NAME}/.venv/gia/bin/pip install --upgrade pip setuptools wheel && \
grep -Ev "^(git\\+https://git\\.zm\\.is/|aiograpi$)" /tmp/requirements.txt > /tmp/requirements.build.txt && \
/home/${USER_NAME}/.venv/gia/bin/pip install -r /tmp/requirements.build.txt'
ENV VIRTUAL_ENV=/home/${USER_NAME}/.venv/gia
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
CMD ["/bin/bash"]