chore: enhance devcontainer setup with command history and GPG signing scripts

This commit is contained in:
Denys Vuika
2026-07-08 12:45:06 +00:00
parent 4b27f9978d
commit e23950338c
4 changed files with 24 additions and 5 deletions
+4 -2
View File
@@ -18,6 +18,8 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium gnupg2 \ && apt-get install -y --no-install-recommends chromium gnupg2 \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& corepack enable \ && corepack enable \
&& mkdir -p ${PNPM_HOME} /home/node/.pnpm-store \ && mkdir -p ${PNPM_HOME} /home/node/.pnpm-store /commandhistory \
&& chown -R node:node /home/node/.local /home/node/.pnpm-store && touch /commandhistory/.bash_history \
&& chown -R node:node /home/node/.local /home/node/.pnpm-store /commandhistory \
&& echo "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" >> /home/node/.bashrc
USER node USER node
+6 -3
View File
@@ -52,11 +52,14 @@
"CHROME_BIN": "/usr/bin/chromium" "CHROME_BIN": "/usr/bin/chromium"
}, },
"mounts": ["source=alfresco-ng2-pnpm-store,target=/home/node/.pnpm-store,type=volume"], "mounts": [
"source=workspace-pnpm-store,target=/home/node/.pnpm-store,type=volume",
"source=workspace-bashhistory,target=/commandhistory,type=volume"
],
"postCreateCommand": "pnpm install --frozen-lockfile", "postCreateCommand": ".devcontainer/post-create.sh",
"postStartCommand": "if [ -f .git/signing.pub ]; then gpg --import .git/signing.pub; fi", "postStartCommand": ".devcontainer/post-start.sh",
"runArgs": ["--cap-drop=ALL", "--security-opt=no-new-privileges:true", "--pids-limit=512"] "runArgs": ["--cap-drop=ALL", "--security-opt=no-new-privileges:true", "--pids-limit=512"]
} }
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
if command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; then
sudo chown -R "$(whoami)": /commandhistory
fi
pnpm install --frozen-lockfile
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
if [ -f .git/signing.pub ]; then
gpg --import .git/signing.pub
fi