-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Injecting information about port mapping (docker) to CLI #4558
Comments
The external port is set in your docker config / command, so vue cli can't influence that. AFAIK it's also impossible from within a docker container to get info about which internal ports are mapped to which external ports. |
Not correct information, actually. You could set up your container's environment variables, for example, via docker-compose: https://docs.docker.com/compose/environment-variables/, and you could set up any values you want. I do not need to affect my docker config/command. The thing I only wanted to change - is only CLI message after successful compile. My team members use the links this message shows to access SPA in a browser directly from the IDE terminal. This a convenient feature, which we wanna use further, and trying to setup CLI to show the correct link, using data injected via environment variables defined via docker-compose. Fragment from my docker-compose.yml: environment:
UID: ${uid}
GID: ${gid}
PORT_WEBPACK: ${port_webpack}
PORT_SANDBOX: ${port_sandbox}
PORT_KARMA: ${port_karma}
ports:
- "${port_webpack}:8080"
- "${port_sandbox}:8081"
- "${port_karma}:9876" I open my container, then echo $PORT_WEBPACK, for example, gets 4180 if this port was specified for 8080 in up command. My team already uses information about mapping for KarmaJS, it generates links, used for testing in browser capture mode. For example, we use that feature for testing our app under IE from VirtualBox on Ubuntu. |
I'd like to use something similar to module.exports = {
// ...
externalPort: process.env.PORT_WEBPACK
// ...
} or some CLI hook, where I could be able to determine the whole message text. |
Thanks for the additional information, now I understand what you actually want - juts change the message text. Iniitially It sounded to me like you expected Vue CLI to set this port or automacigally detect it. The additional examples made it clearer. |
What problem does this feature solve?
Inside docker container, CLI generates a message like:
It seems you are running Vue CLI inside a container.
Access the dev server via http://localhost:<your container's external mapped port>/
I propose to add configuration settings for this <your container's external mapped port> to force CLI to generate a correct external link instead of the message above.
https://stackoverflow.com/questions/57752780/how-to-change-vue-cli-message-after-successfull-compile-app-running-at
What does the proposed API look like?
Something like
Or maybe it is possible to use some CLI hooks, to affect the final message, currently not able to find an appropriate option.
The text was updated successfully, but these errors were encountered: