Description
Hello,
Apologies if this has been asked before or if I'm missing something really obvious.
I'm currently locally running a Dockerized Symfony app, with a node
container running the dev-server command. Now, while this runs great when developing, I've been running into an issue when trying to implement E2E tests using Panther, where the test browser (running in the php
container) cannot access assets.
My understanding of the issue is that the entrypoints.json
file points to the correct URL when developing (localhost:8080
) but since the test browser is running in the php
container, the correct URL would be node:8080
or host.docker.internal:8080
.
I've tried to change this manually in entrypoints.json
as a test, and it does work, but my real browser can in turn no longer access the dev-server assets.
My question is now: How do I achieve this without having to launch a command before running my tests again? I'm aware I could use watch mode instead, but I'd like to keep the benefits of using dev-server and be able to run my tests from my IDE without having to worry about what command my node
container is currently running. I suppose I could also build my assets before running tests, but this slows down the process a considerable amount.
My node container command:
command: 'sh -c "npm install; npm run dev-server -- --live-reload --server-type https --client-web-socket-url https://localhost:8080/ws --host 0.0.0.0 --public https://localhost:8080 --allowed-hosts all"'
Options I've thought of so far:
- Dynamically modify the entrypoints URL depending on .env (
dev
andpanther
)- Not sure if this is possible
- Use multiple builds
- This seems to not be currently possible Webpack server options not used to define entrypoints url #1117
Would greatly appreciate any help or ideas on this.
Cheers.