From 5aa7d1485fd60f24f24473ffe21689d14716d4bd Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Mon, 15 Jul 2024 18:06:13 +0200 Subject: [PATCH] backup Signed-off-by: Andreas Heinrich --- .../docker-compose.yml | 37 +++++--------- .../documentation-devcontainer/Dockerfile | 50 ------------------- .../devcontainer.json | 31 ------------ .../general-devcontainer/Dockerfile | 12 +++++ .../general-devcontainer/devcontainer.json | 27 ++++++++-- .../docker-compose.devcontainer.yml | 15 ++++++ 6 files changed, 61 insertions(+), 111 deletions(-) rename devcontainer/template/.devcontainer/{general-devcontainer => }/docker-compose.yml (54%) delete mode 100644 devcontainer/template/.devcontainer/documentation-devcontainer/Dockerfile delete mode 100644 devcontainer/template/.devcontainer/documentation-devcontainer/devcontainer.json create mode 100644 devcontainer/template/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml diff --git a/devcontainer/template/.devcontainer/general-devcontainer/docker-compose.yml b/devcontainer/template/.devcontainer/docker-compose.yml similarity index 54% rename from devcontainer/template/.devcontainer/general-devcontainer/docker-compose.yml rename to devcontainer/template/.devcontainer/docker-compose.yml index 836ef7e..f95b733 100644 --- a/devcontainer/template/.devcontainer/general-devcontainer/docker-compose.yml +++ b/devcontainer/template/.devcontainer/docker-compose.yml @@ -6,36 +6,21 @@ volumes: node-red-data: external: false -# networks: -# default: -# external: true -# name: infranet_network - services: - devcontainer: - build: - context: . - dockerfile: Dockerfile - volumes: - - ..:/workspace - command: sleep infinity - depends_on: - - mqtt-server - environment: - MQTT_SERVER_ADRESS: mqtt-server - MQTT_SERVER_PORT: 1883 mqtt-server: - image: ghcr.io/everest/everest-dev-environment/mosquitto:refactor/docker-images + image: ghcr.io/everest/everest-dev-environment/mosquitto:refactor-docker-images ports: - - 1883:1883 - - 9001:9001 + # allow multiple ports for host to avoid conflicts with other dev environments + - 1883-1983:1883 + - 9001-9101:9001 ocpp-db: image: mariadb:10.4.30 # pinned to patch-version because https://github.com/steve-community/steve/pull/1213 volumes: - ocpp-db-data:/var/lib/mysql ports: - - 13306:3306 + # allow multiple ports for host to avoid conflicts with other dev environments + - 13306-13406:3306 environment: MYSQL_RANDOM_ROOT_PASSWORD: "yes" MYSQL_DATABASE: ocpp-db @@ -43,10 +28,11 @@ services: MYSQL_PASSWORD: ocpp steve: - build: ghcr.io/everest/everest-dev-environment/steve:refactor/docker-images + image: ghcr.io/everest/everest-dev-environment/steve:refactor-docker-images ports: - - 8180:8180 - - 8443:8443 + # allow multiple ports for host to avoid conflicts with other dev environments + - 8180-8280:8180 + - 8443-8543:8443 depends_on: - ocpp-db @@ -57,4 +43,5 @@ services: depends_on: - mqtt-server ports: - - 1880:1880 + # allow multiple ports for host to avoid conflicts with other dev environments + - 1880-1980:1880 diff --git a/devcontainer/template/.devcontainer/documentation-devcontainer/Dockerfile b/devcontainer/template/.devcontainer/documentation-devcontainer/Dockerfile deleted file mode 100644 index 63f7606..0000000 --- a/devcontainer/template/.devcontainer/documentation-devcontainer/Dockerfile +++ /dev/null @@ -1,50 +0,0 @@ -FROM debian:bullseye-slim - -ARG BASE_IMAGE -ARG USERNAME=docker -ARG USER_UID=1000 - -# run update -RUN apt-get update - -# install necessary packages -RUN apt-get install --no-install-recommends -y \ - sudo \ - python3 \ - python3-pip \ - python-is-python3 \ - git \ - ssh \ - make - -# create user and add to sudoers -RUN useradd -ms /bin/bash -u ${USER_UID} -U ${USERNAME} \ - && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \ - && chmod 0440 /etc/sudoers.d/${USERNAME} - -# install sphinx related -RUN pip3 install \ - sphinx==5.3.0 \ - sphinx_rtd_theme==0.5.1 \ - doc8==1.0.0 \ - esbonio==0.14.3 - -# install latex for sphinx -RUN apt-get install --no-install-recommends -y \ - latexmk \ - texlive-latex-recommended \ - texlive-latex-extra \ - tex-gyre - -# clean up -RUN apt-get clean - -# EVerest docu additions -RUN pip3 install \ - sphinxcontrib-contentui==0.2.5 \ - PyYAML==6.0 - -USER ${USERNAME} - -ENV PATH="/home/${USERNAME}/.local/bin:${PATH}" - diff --git a/devcontainer/template/.devcontainer/documentation-devcontainer/devcontainer.json b/devcontainer/template/.devcontainer/documentation-devcontainer/devcontainer.json deleted file mode 100644 index 205b449..0000000 --- a/devcontainer/template/.devcontainer/documentation-devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "EVerest Documentation Dev Container", - "remoteUser": "docker", - "workspaceFolder": "/workspace", - "build": { - "dockerfile": "Dockerfile" - }, - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "stkb.rewrap", - "lextudio.restructuredtext", - "trond-snekvik.simple-rst", - "ritwickdey.liveserver" - ], - "settings": { - "python.defaultInterpreterPath": "/usr/bin/python3", - "editor.rulers": [ - 79, - 120 - ], - "esbonio.sphinx.buildDir": "${workspaceFolder}/everest/docs/_build", - "esbonio.sphinx.confDir": "${workspaceFolder}/everest/docs", - "restructuredtext.preview.scrollEditorWithPreview": false, - "restructuredtext.pythonRecommendation.disabled": true, - "liveServer.settings.root": "${workspaceFolder}/everest/docs/_build/html" - } - } - } -} \ No newline at end of file diff --git a/devcontainer/template/.devcontainer/general-devcontainer/Dockerfile b/devcontainer/template/.devcontainer/general-devcontainer/Dockerfile index d04e1f0..81eb683 100644 --- a/devcontainer/template/.devcontainer/general-devcontainer/Dockerfile +++ b/devcontainer/template/.devcontainer/general-devcontainer/Dockerfile @@ -6,3 +6,15 @@ RUN sudo apt update RUN echo "echo \"🏔️ 🚘 Welcome to the EVerest development environment!\"" >> ${HOME}/.bashrc RUN echo "echo \"To initialize the EVerest workspace please run the following command:\"" >> ${HOME}/.bashrc RUN echo "echo \"edm init main\"" >> ${HOME}/.bashrc + +RUN sudo apt install -y --no-install-recommends \ + python3-sphinx=5.3.0-4 + +RUN python3 -m pip install --break-system-packages \ + # Sphinx extensions + sphinxcontrib-contentui==0.2.5 \ + sphinxcontrib-svg2pdfconverter==1.2.2 \ + # language server RST/Sphinx + esbonio==0.16.4 \ + # Style checker for RST/Sphinx + doc8==1.1.1 \ No newline at end of file diff --git a/devcontainer/template/.devcontainer/general-devcontainer/devcontainer.json b/devcontainer/template/.devcontainer/general-devcontainer/devcontainer.json index 6349217..53a5e60 100644 --- a/devcontainer/template/.devcontainer/general-devcontainer/devcontainer.json +++ b/devcontainer/template/.devcontainer/general-devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { - "name": "EVerest Debian Devenvironment", - "dockerComposeFile": "./docker-compose.yml", + "name": "EVerest Debian Devenvironment2", + "dockerComposeFile": ["../docker-compose.yml", "./docker-compose.devcontainer.yml"], "service": "devcontainer", "remoteUser": "docker", "workspaceFolder": "/workspace", @@ -15,13 +15,30 @@ } }, "terminal.integrated.defaultProfile.linux": "bash", - "python.pythonPath": "/usr/bin/python3" + "python.pythonPath": "/usr/bin/python3", + "python.defaultInterpreterPath": "/usr/bin/python3", + "editor.rulers": [79, 120], + // RST/Sphinx language server + "esbonio.sphinx.buildDir": "${workspaceFolder}/everest/docs/_build", + "esbonio.sphinx.confDir": "${workspaceFolder}/everest/docs", + // RST + "restructuredtext.preview.scrollEditorWithPreview": false, + "restructuredtext.pythonRecommendation.disabled": true, + "liveServer.settings.root": "/everest/docs/_build/html" }, "extensions": [ - "ms-python.python", + // language support CPP "ms-vscode.cpptools", + // language support cmake "twxs.cmake", - "ms-vscode.cmake-tools" + "ms-vscode.cmake-tools", + // language support python + "ms-python.python", + // language support restructured text + "lextudio.restructuredtext", + "trond-snekvik.simple-rst", + // doc live server + "ritwickdey.liveserver" ] } } diff --git a/devcontainer/template/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml b/devcontainer/template/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml new file mode 100644 index 0000000..59f4cc4 --- /dev/null +++ b/devcontainer/template/.devcontainer/general-devcontainer/docker-compose.devcontainer.yml @@ -0,0 +1,15 @@ +version: "3.6" + +services: + devcontainer: + build: + context: ./general-devcontainer + dockerfile: Dockerfile + volumes: + - type: bind + source: .. + target: /workspace + command: sleep infinity + environment: + MQTT_SERVER_ADRESS: mqtt-server + MQTT_SERVER_PORT: 1883