-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Docker caveat #538
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Question and answer
Hello, I faced the problem with loading image as seen in this issue.
All fixes were made without any success. But after a repairing night, the solution come to me, so I would like to share it with you.
I've read lot of issues here and on DomPDF repo as well.
I saw on the DomPDF options that
ext_curl
orallow_url_fopen
should be enabled, so images where not loaded directly by the web server but by the PHP engine.And because I'm using docker with to separate container it could nerver work.
This couldn't be fix on the package but a notice can be set.
Using docker-compose on
{{ absolute_url(asset( <image path> )) }}
I just replace the host (localhost in my case) with the "linked" container name (web in my case).A simple
{{ absolute_url(asset( <image path> ))|replace({'localhost': 'web'}) }}
fix my problem.In fact this solution should be per project, I personally create a Twig extension that replace it only on Dev env.
The text was updated successfully, but these errors were encountered: