Skip to content
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

Open
kl3sk opened this issue Mar 3, 2023 · 0 comments
Open

Docker caveat #538

kl3sk opened this issue Mar 3, 2023 · 0 comments

Comments

@kl3sk
Copy link
Contributor

kl3sk commented Mar 3, 2023

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 or allow_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant