fix devcontainer starup issue.

This commit is contained in:
Adam Outler
2026-01-03 23:31:41 +00:00
parent 3cf856f1c2
commit f549db3ea9
7 changed files with 48 additions and 7 deletions

View File

@@ -276,7 +276,8 @@ USER root
# Install common tools, create user, and set up sudo
# Ensure entrypoint scripts stay executable in the devcontainer (avoids 126 errors)
RUN chmod +x /entrypoint.sh /root-entrypoint.sh /entrypoint.d/*.sh || true
RUN chmod +x /entrypoint.sh /root-entrypoint.sh /entrypoint.d/*.sh && \
chmod +x /entrypoint.d/35-apply-conf-override.sh
RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \
pytest-cov zsh alpine-zsh-config shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \

View File

@@ -48,11 +48,11 @@
"postCreateCommand": {
"Install Pip Requirements": "/opt/venv/bin/pip3 install pytest docker debugpy",
"Workspace Instructions": "printf '\n\n<> DevContainer Ready!\n\n📁 To access /tmp folders in the workspace:\n File → Open Workspace from File → NetAlertX.code-workspace\n\n📖 See .devcontainer/WORKSPACE.md for details\n\n'"
"Workspace Instructions": "printf '\n\n<> DevContainer Ready! Starting Services...\n\n📁 To access /tmp folders in the workspace:\n File → Open Workspace from File → NetAlertX.code-workspace\n\n📖 See .devcontainer/WORKSPACE.md for details\n\n'"
},
"postStartCommand": {
"Start Environment":"${containerWorkspaceFolder}/.devcontainer/scripts/setup.sh",
"Build test-container":"echo building netalertx-test container in background. check /tmp/build.log for progress. && setsid docker buildx build -t netalertx-test . > /tmp/build.log 2>&1 &"
"Build test-container":"echo To speed up tests, building test container in background... && setsid docker buildx build -t netalertx-test . > /tmp/build.log 2>&1 && echo '🧪 Unit Test Docker image built: netalertx-test' &"
},
"customizations": {
"vscode": {

View File

@@ -23,7 +23,8 @@ USER root
# Install common tools, create user, and set up sudo
# Ensure entrypoint scripts stay executable in the devcontainer (avoids 126 errors)
RUN chmod +x /entrypoint.sh /root-entrypoint.sh /entrypoint.d/*.sh || true
RUN chmod +x /entrypoint.sh /root-entrypoint.sh /entrypoint.d/*.sh && \
chmod +x /entrypoint.d/35-apply-conf-override.sh
RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \
pytest-cov zsh alpine-zsh-config shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \

View File

@@ -47,6 +47,9 @@ sudo mount -t tmpfs -o size=50m,mode=0777 tmpfs /tmp/nginx 2>/dev/null || true
sudo chmod 777 /tmp/log /tmp/api /tmp/run /tmp/nginx
# Create critical subdirectories immediately after tmpfs mount
sudo install -d -m 777 /tmp/run/tmp
sudo install -d -m 777 /tmp/log/plugins
sudo rm -rf /entrypoint.d
@@ -85,9 +88,7 @@ sudo chmod 777 "${LOG_DB_IS_LOCKED}"
sudo pkill -f python3 2>/dev/null || true
sudo chmod 777 "${PY_SITE_PACKAGES}" "${NETALERTX_DATA}" "${NETALERTX_DATA}"/* 2>/dev/null || true
sudo chmod 005 "${PY_SITE_PACKAGES}" 2>/dev/null || true
sudo chmod -R 777 "${PY_SITE_PACKAGES}" "${NETALERTX_DATA}" 2>/dev/null || true
sudo chown -R "${NETALERTX_USER}:${NETALERTX_GROUP}" "${NETALERTX_APP}"
date +%s | sudo tee "${NETALERTX_FRONT}/buildtimestamp.txt" >/dev/null