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

Add support for running inside a Sail container #7

Merged
merged 1 commit into from
May 25, 2022
Merged

Conversation

jessarcher
Copy link
Member

When running inside a Docker container, the Vite server needs to listen on the container's external address rather than just its localhost address.

The port also needs to be forwarded on the host machine to the container. We can achieve this with the following port configuration in the laravel.test container in Sail:

- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'

The port specified here is the new default as of Vite 3 (currently unreleased). We can safely use it now because our plugin will also specify that port when running in Docker.

Copy link
Member

@timacdonald timacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. As long as Vite doesn't replace the env with something weird, LGTM

@jessarcher jessarcher merged commit fb0237a into main May 25, 2022
@jessarcher jessarcher deleted the sail-support branch May 25, 2022 07:00
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

Successfully merging this pull request may close these issues.

2 participants