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

Access dev-server from inside and outside docker #1202

Open
packagespace opened this issue Apr 12, 2023 · 0 comments
Open

Access dev-server from inside and outside docker #1202

packagespace opened this issue Apr 12, 2023 · 0 comments

Comments

@packagespace
Copy link

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:

Would greatly appreciate any help or ideas on this.

Cheers.

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

No branches or pull requests

1 participant