-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build dependencies with docker #1200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP part is awesome. +2
Have doubts concerning the node part. We briefly talked about permission problems, to which this may be a solution, but I would hope there are others.
In dev, when developing cat17, my npm was
docker run --rm -v $PWD/skins/cat17:/data:delegated -v ~/.npm:/npm-cache -e "REDUX_LOG=on" digitallyseamless/nodejs-bower-grunt npm run build-assets
- so no custom docker image. Unless we really need to change this I would try and stick with this (not having to build custom image).
Side note: In my dream world build steps in dev and on build are identical (safe for a .env
file maybe) - and AFAIK none of us is using ansible in dev. Hence the make
-approach (e.g. fundraising-memberships) as the lowest common denominator was the closest to a perfect solution in that regard I have seen. Would it not be worth striving for simply calling something akin to make js
from ansible?
Sounds like such a worthwhile to me |
The reason why I opted for the custom build image was user permissions, especially for the If you try to add |
Nice findings and workaround. I may not look beautiful, but it clearly separates the tool's build time from our application's build time - what I missed in the custom image approach. I agree that having to pass in all that information at run time feels cumbersome, OTOH you took away all the parts that could be taken away while keeping it functional. What remains is needed to work around current(?) limitations in node/npm. Would be great if we could identify open tickets (sure there are with docker gaining more and more popularity) to be able to regularly check them to see if our mitigation is still needed. Questions
|
One reason is that creating TMPFILE in a Makefile, without conflicting with other software that uses
I ran into a peculiar Docker for Mac issue, where the tmp dir can't be selected as a folder that's accessible to the Docker environment, because it's a symlink that's resolved in the configuration GUI but not in the
Just a vague notion of "I don't know if I want to have I'll do a followup. |
4982694
to
a999b1a
Compare
c03c699
to
8eb720a
Compare
8eb720a
to
82b7925
Compare
Now the |
Call "composer install" with a Docker image. Add Docker image that builds the skin assets with node.js Due to npm permission madness (npm needs to be run as root, but then all its generated files are owned by root), we use a custom Dockerfile. This allows the build machine ("local") to be free of application dependencies (PHP with all its extensions, node.js). It only needs Git and Docker.
The `include` task is deprecated, `include_tasks` needs to be used instead. The `working_dir` parameter for `docker_image` from the previous commit is only available in Ansible 2.4
82b7925
to
ffc8905
Compare
Add make targets that use Docker to install PHP and Node dependencies. Use make targets in ansible build task to make deploy and local dev more consistent.
ffc8905
to
07a0f15
Compare
Temporary fix until #1200 is merged, otherwise Travis won't install npm packages.
Temporary fix until #1200 is merged, otherwise Travis won't install npm packages.
Ping @wiese : Could you have another look at my changes since the last review? Is this now more in the direction you imagined? |
Self-merging for now to be able to deploy, but feel free to comment and request changes ... |
Use Docker images to compile the frontend assets and install PHP dependencies.
This allows the build machine ("local") to be free of application
dependencies (PHP with all its extensions, node.js). It only needs Git
and Docker.