Replace docker compose with persistent per-project lifecycle
Move from docker compose run to a Python-managed container lifecycle. Each project now gets a dedicated container that is started on demand and stopped when opencode exits, instead of being recreated each time. Use a shared home directory across projects so configurations presist. The container are not destroyed, so tools and caches can be installed specifically for a project by opencode itself once and reused, while still avoiding long-running containers.
This commit is contained in:
parent
57ef6454c6
commit
fc2e5b1bca
4 changed files with 168 additions and 49 deletions
14
Dockerfile
14
Dockerfile
|
|
@ -10,9 +10,11 @@ RUN pacman -Syu --noconfirm \
|
|||
ca-certificates \
|
||||
bash \
|
||||
less \
|
||||
ripgrep && \
|
||||
ripgrep \
|
||||
sudo && \
|
||||
groupadd -g ${GID} ${USERNAME} && \
|
||||
useradd -m -u ${UID} -g ${GID} -s /bin/bash ${USERNAME} && \
|
||||
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
|
||||
pacman -Scc --noconfirm
|
||||
|
||||
WORKDIR /tmp
|
||||
|
|
@ -20,12 +22,8 @@ USER ${USERNAME}
|
|||
|
||||
RUN git clone https://aur.archlinux.org/opencode-bin.git && \
|
||||
cd opencode-bin && \
|
||||
makepkg --noconfirm
|
||||
makepkg --syncdeps --noconfirm --install && \
|
||||
sudo rm -rf /tmp/opencode-bin && \
|
||||
sudo pacman -Scc --noconfirm
|
||||
|
||||
USER root
|
||||
RUN pacman -U --noconfirm /tmp/opencode-bin/*.pkg.tar.zst && \
|
||||
rm -rf /tmp/opencode-bin && \
|
||||
pacman -Scc --noconfirm
|
||||
|
||||
USER ${USERNAME}
|
||||
WORKDIR /home/${USERNAME}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue