This PR adds Docker support to the project, making it easier to run consistently across environments.#30
This PR adds Docker support to the project, making it easier to run consistently across environments.#30CLGREEN94 wants to merge 2 commits into
Conversation
Add Dockerized runtime and docker-compose for Sonar Poller
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 616fe57a78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| RUN mkdir -p permanent_config logs \ | ||
| && touch permanent_config/database \ | ||
| && cp -R vendor/sonarsoftwareinc/external_tool_template/assets/* www/ \ |
There was a problem hiding this comment.
Preserve the assets directory when copying web assets
Because the Docker build disables Composer scripts, this line is the only replacement for the existing post-install-cmd asset copy. Using assets/* copies css, js, and brand directly into www/, while the templates request paths under assets/... such as assets/css/bootstrap.min.css and assets/js/custom.js; Docker-built containers therefore serve the UI without its CSS/JS/logo assets. Copy the assets directory itself into www/ as the Composer script does.
Useful? React with 👍 / 👎.
| RUN mkdir -p permanent_config logs \ | ||
| && touch permanent_config/database \ |
There was a problem hiding this comment.
Make the SQLite data path writable by php-fpm
When the Docker UI handles Settings or Device Credentials through php-fpm, the worker runs as the default www-data user, but this creates the SQLite database as root and the compose bind mount can also mask it with a host directory that is not writable by www-data. In a fresh docker compose up, the poller/root process can create or own permanent_config/database, after which web requests that update settings fail with SQLite permission errors. Chown the application data directories/file for the PHP user or run the relevant processes with consistent ownership.
Useful? React with 👍 / 👎.
Changes
Dockerfilefor building the application imagedocker-compose.ymlfor local development.gitignoreto exclude Docker-related artifacts