Conversation
…ge and only copy needed files in runtime container
|
Thanks for the PR. There are a lot of good improvements here. Regarding the Skosmos/src/controller/Controller.php Lines 150 to 185 in 4d120d2 As long as this is the case, the git command and the IIRC, this check for the latest git commit is a mechanism to invalidate caches when the code changes for example via |
|
That's what I thought. I guess that the proper way to handle this issue is to prevent the I also noticed it happens in the phpunit tests but I would argue that it might be better to add git package to the development stage so the tests passes whether it is in a docker container or not. If it is OK for you I will update this PR so it is properly handled. |
|
Sounds good, please do make the changes in this PR! |
.dockerignore
Outdated
| .DS_Store | ||
| .phpunit.result.cache | ||
| .git | ||
| ansible |
There was a problem hiding this comment.
FYI, the ansible directory was just removed in #1920 so this line is no longer necessary (although it does no harm)
There was a problem hiding this comment.
I did removed the ansible directory from the .dockerignore
Is the ansible.cfg also going to be removed ?
There was a problem hiding this comment.
Good point. I removed ansible.cfg, along with a few other files, in PR #1923.
The project has a long history and some cruft has accumulated that wasn't actually being used. Thank you for pointing these out!
|
|
git shell calls have been changed to redirect the There is still some SonarCloud Code Analysis that raises an error when I copy all sources recursively in the composer stage. This can be marked as safe since the final stage copy specific files only. |
|
Sorry this didn't quite make it into the 3.1 release. There is quite a lot to test and digest here. But we will get back to it soon. |
|
Great, thank you. |


Reasons for creating this PR
Link to relevant issue(s), if any
N/A
Description of the changes in this PR
This PR improves the Docker build process by reducing the production image size and updating outdated dependencies.
Key changes:
.dockerignoreto exclude development and unnecessary files from the Docker build contextDockerfile.ubuntuthat includes files needed for testing (used bytests/docker-compose.yml)Files excluded from production image:
.codeclimate.yml,.jshintrc,phpunit.xml,.sonarcloud.propertiesREADME.md,CONTRIBUTING.md,LICENSE,SECURITY.md,PULL_REQUEST_TEMPLATE.mdansible/,tests/,.github/,dockerfiles/,composer.lock,composer.phar,phpdoc.shdocker-compose.yml,Vagrantfile,cypress.config.js,.gitignore,.dockerignore,ansible.cfgThese changes reduce the attack surface and image size while maintaining full functionality in production.
Known problems or uncertainties in this PR
Removed the
gitpackage from the Docker image since there is no.gitdirectory in the production build. This results in ash: 1: git: not founderror appearing in logs on page requests. Options to resolve:gitpackage to the image, orInput needed on the preferred approach.
Checklist
.sr-onlyclass, color contrast)