Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is updating the code so that running WooCommerce in Docker is now fully functional.
When the plugin needs to query the local zaprite API, we can't use localhost because it would point to the docker's network. This is why I've setup the zaprite API url to
http://host.docker.internal:3000
in docker-compose. This points tolocalhost
on the host's network (your computer).But when we want to redirect to a zaprite app page, then
host.docker.internal
would not work because it's loaded in your browser, not inside Docker. In that case we need it to belocalhost
.This is why I changed
ZAPRITE_PATH
PHP constant toZAPRITE_APP_URL
andZAPRITE_API_URL
. Here is how they are setup in docker-compose:Note that
ZAPRITE_API_URL
defaults toZAPRITE_APP_URL
, so you still need to change a single variable when testing with Locals for example.Anyway, now the Docker setup is fully working and I think is much easier when testing locally because:
All you need to do is:
cd wordpress-docker && docker-compose up -d