# Devcontainer build stage (do not build directly) # This file is combined with the root /Dockerfile by # .devcontainer/scripts/generate-configs.sh # The generator appends this stage to produce .devcontainer/Dockerfile. # Prefer to place dev-only setup here; use setup.sh only for runtime fixes. FROM runner AS netalertx-devcontainer ENV INSTALL_DIR=/app ENV PYTHONPATH=/workspaces/NetAlertX/test:/workspaces/NetAlertX/server:/app:/app/server:/opt/venv/lib/python3.12/site-packages:/usr/lib/python3.12/site-packages ENV PATH=/services:${PATH} ENV PHP_INI_SCAN_DIR=/services/config/php/conf.d:/etc/php83/conf.d ENV LISTEN_ADDR=0.0.0.0 ENV PORT=20211 ENV NETALERTX_DEBUG=1 ENV PYDEVD_DISABLE_FILE_VALIDATION=1 COPY .devcontainer/resources/devcontainer-overlay/ / USER root # Install common tools, create user, and set up sudo RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \ pytest-cov fish shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \ docker-cli-compose RUN install -d -o netalertx -g netalertx -m 755 /services/php/modules && \ cp -a /usr/lib/php83/modules/. /services/php/modules/ && \ echo "${NETALERTX_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers RUN mkdir /workspaces && \ install -d -o netalertx -g netalertx -m 777 /services/run/logs && \ install -d -o netalertx -g netalertx -m 777 /app/run/tmp/client_body && \ sed -i -e 's|:/app:|:/workspaces:|' /etc/passwd && \ find /opt/venv -type d -exec chmod o+rwx {} \; USER netalertx ENTRYPOINT ["/bin/sh","-c","sleep infinity"]