Fix dev container permission issues (#1788)

* Fix dev container permission issues by removing USER directive

Removes USER directive from Dockerfile.dev files to fix permission denied errors
when accessing bind-mounted workspaces. Dev containers now run as root, which is
standard practice for local development environments and matches the original
working configuration before PR #1759.

Fixes #1782

* Fix dev container permission issues and Poetry 2.0 compatibility

- Remove USER directive from Dockerfile.dev files to fix permission errors
- Remove poetry shell commands (not available in Poetry 2.0)
- Configure VS Code to use Poetry venv automatically

Fixes #1782

---------

Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
This commit is contained in:
Dor Lugasi-Gal
2025-11-25 15:01:12 +02:00
committed by GitHub
parent 23c868a5c5
commit a47837b20a
7 changed files with 37 additions and 35 deletions

View File

@@ -9,13 +9,17 @@
"POETRY_EXTRAS": "-E transformers"
}
},
"workspaceMount": "source=${localWorkspaceFolder}/presidio-analyzer,target=/workspace,type=bind",
"workspaceFolder": "/workspace",
"postCreateCommand": "chmod +x ./install_dependencies.sh && ./install_dependencies.sh",
"postAttachCommand": "poetry shell",
"workspaceMount": "source=${localWorkspaceFolder}/presidio-analyzer,target=/workspace,type=bind",
"workspaceFolder": "/workspace",
"postCreateCommand": "chmod +x ./install_dependencies.sh && ./install_dependencies.sh",
"customizations": {
"extensions": [
"ms-python.python",
],
"vscode": {
"extensions": [
"ms-python.python"
],
"settings": {
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
}
}
}

View File

@@ -9,10 +9,15 @@
},
"workspaceMount": "source=${localWorkspaceFolder}/presidio-analyzer,target=/workspace,type=bind",
"workspaceFolder": "/workspace",
"postAttachCommand": "chmod +x ./install_dependencies.sh && ./install_dependencies.sh && poetry shell",
"postAttachCommand": "chmod +x ./install_dependencies.sh && ./install_dependencies.sh",
"customizations": {
"extensions": [
"ms-python.python",
],
"vscode": {
"extensions": [
"ms-python.python"
],
"settings": {
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
}
}
}

View File

@@ -11,10 +11,14 @@
"install",
"--no-interaction"
],
"postAttachCommand": "poetry shell",
"customizations": {
"extensions": [
"ms-python.python",
],
"vscode": {
"extensions": [
"ms-python.python"
],
"settings": {
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
}
}
}

View File

@@ -11,10 +11,14 @@
"install",
"--no-interaction"
],
"postAttachCommand": "poetry shell",
"customizations": {
"extensions": [
"ms-python.python",
],
"vscode": {
"extensions": [
"ms-python.python"
],
"settings": {
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
}
}
}

View File

@@ -18,8 +18,3 @@ RUN apt-get update \
&& apt-get install -y build-essential
RUN pip install poetry
# Create a non-root user for development
RUN useradd -m -u 1001 presidio
USER 1001

View File

@@ -5,8 +5,3 @@ RUN apt-get update \
&& apt-get install -y build-essential
RUN pip install poetry
# Create a non-root user for development
RUN useradd -m -u 1001 presidio
USER 1001

View File

@@ -14,8 +14,3 @@ RUN apt-get update \
&& apt-get install ffmpeg libsm6 libxext6 -y
RUN pip install poetry
# Create a non-root user for development
RUN useradd -m -u 1001 presidio
USER 1001