Browse Source

updates shell settings and adds postCreateCommand to ensure user install is linked to system install

Jaco Verster 1 year ago
parent
commit
8606d4c9e7
2 changed files with 14 additions and 5 deletions
  1. 2 2
      .devcontainer/Dockerfile
  2. 12 3
      .devcontainer/devcontainer.json

+ 2 - 2
.devcontainer/Dockerfile

@@ -5,7 +5,6 @@ ENV POETRY_VERSION=1.6.1 \
     POETRY_VIRTUALENVS_IN_PROJECT=false \
     POETRY_VIRTUALENVS_CREATE=false \
     DEBIAN_FRONTEND=noninteractive \
-    SHELL=/bin/bash \
     DISPLAY=:99
 
 # Install packages
@@ -23,12 +22,13 @@ RUN groupadd --gid $USER_GID $USERNAME \
     && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
     && chmod 0440 /etc/sudoers.d/$USERNAME
 
+ENV PATH="/home/${USERNAME}/.local/bin:${PATH}"
+
 # Install nicegui
 RUN pip install -U pip && pip install poetry==$POETRY_VERSION
 COPY nicegui pyproject.toml poetry.lock README.md ./
 RUN poetry install --all-extras
 
-WORKDIR /workspaces/nicegui
 USER $USERNAME
 
 ENTRYPOINT ["poetry", "run", "python", "-m", "debugpy", "--listen" ,"5678", "main.py"]

+ 12 - 3
.devcontainer/devcontainer.json

@@ -16,10 +16,19 @@
         "samuelcolvin.jinjahtml",
         "ms-python.isort",
         "Vue.volar"
-      ]
+      ],
+      "settings": {
+        "terminal.integrated.shell.linux": "bash",
+        "terminal.integrated.profiles.linux": {
+          "bash (container default)": {
+            "path": "/usr/bin/bash",
+            "overrideName": true
+          }
+        }
+      }
     }
   },
-  "runArgs": ["--net", "host"],
   // More info: https://aka.ms/dev-containers-non-root.
-  "remoteUser": "vscode"
+  "remoteUser": "vscode",
+  "postCreateCommand": "poetry install --all-extras"
 }