From 57a49444c6ba6c1c99d0f8a69ba67a8e30049d6c Mon Sep 17 00:00:00 2001 From: Ludy Date: Sun, 2 Mar 2025 21:13:14 +0100 Subject: [PATCH] Fix: Devcontainer permission (#3102) # Description of Changes Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details. --- .devcontainer/devcontainer.json | 4 ++-- Dockerfile.dev | 7 ++----- scripts/init-setup.sh | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6827e1098..1bfa99b0d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ // Sets the run context to one level up instead of the .devcontainer folder. "context": "..", // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. - "dockerfile": "../Dockerfile.dev", + "dockerfile": "../Dockerfile.dev" }, // Use 'forwardPorts' to make a list of ports inside the container available locally. "appPort": [8080], @@ -110,5 +110,5 @@ // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. "remoteUser": "devuser", "shutdownAction": "stopContainer", - "postStartCommand": "chmod +x scripts/init-setup.sh && ./scripts/init-setup.sh" + "postStartCommand": "./scripts/init-setup.sh" } diff --git a/Dockerfile.dev b/Dockerfile.dev index afe840e25..dc6f40d73 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -43,11 +43,8 @@ RUN mkdir -p /home/devuser/{configs,logs,customFiles,pipeline/watchedFolders,pip && adduser --disabled-password --gecos '' devuser \ && chown -R devuser:devuser /home/devuser -RUN mkdir -p /home/devuser/logs && chown devuser:devuser /home/devuser/logs -RUN mkdir -p /workspace/logs && chown devuser:devuser /workspace/logs -RUN mkdir -p /workspace/src && chown devuser:devuser /workspace/src -RUN mkdir -p /workspace/src/main && chown devuser:devuser /workspace/src/main -RUN mkdir -p /workspace/src/main/resources && chown devuser:devuser /workspace/src/main/resources +RUN mkdir -p /home/devuser/logs /workspace/logs /workspace/scripts /workspace/src/main/resources \ + && chown -R devuser:devuser /home/devuser /workspace # Setze das Arbeitsverzeichnis (wird später per Bind-Mount überschrieben) WORKDIR /workspace diff --git a/scripts/init-setup.sh b/scripts/init-setup.sh index a495add7c..6b7153cda 100644 --- a/scripts/init-setup.sh +++ b/scripts/init-setup.sh @@ -5,4 +5,4 @@ whoami cd "$(dirname "$0")/.." -./gradlew bootRun +echo "Devcontainer started..."