How to make Encore work with Docker? #3865
Replies: 4 comments 2 replies
-
Hi, have you found the solution? I just configured project, docker and webpack and I face the same issue - it works okay without the docker. In the console I see this:
Why is it being deleted? Also encore doesn't watch for file changes in docker. |
Beta Was this translation helpful? Give feedback.
-
I got a response in the Adonis Discord, in short terms the cookbook for Docker is aimed at production deploys not local development. ------------------ Reply in Discord------------------ |
Beta Was this translation helpful? Give feedback.
-
The guide states:
Another trick is to use host mode networking. Also keep in mind that the |
Beta Was this translation helpful? Give feedback.
-
I managed to solve this by adding the
Added |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have setup an Adonis project using Docker, all worked great until I added Encore, now the assets (js and css) are not loading. In my development environment I can see that it tries to fetch the asset files using
http://0.0.0.0:8080/assets
as host and port, when I manually go tohttp://localhost:8080/assets
I can see the assets. How do I get it to work in my dev env using Docker and Encore..env
docker-compose.yml
If I manually go in and change the entrypoint.json file paths to use localhost and then reload the page it works, but not with the auto-generated 0.0.0.0 host.
I have tried to change HOST in my .env file to localhost without any success.
I have also noted that the changes I do in the js and css files in the resources folder are only showing if I restart the dev environment, does not "hot load". But the changes I do in the edge templates show immediately after refresh.
And if I change the entrypoint.json file in the public folder to use localhost instead of 0.0.0.0 manually all the js and css gets loaded correctly, but as soon as I restart the dev environment it changes back to 0.0.0.0 in the entrypoint.json.
This is how the startup of the application looks in Docker.
Anyone has any ideas on what is missing?
Beta Was this translation helpful? Give feedback.
All reactions