How to change port number when running from docker
thevickypedia opened this issue · 4 comments
thevickypedia commented
I'm using the docker command mentioned in https://github.com/rhasspy/larynx#docker-installation
However, when I flip the port number in the docker run command, it doesn't work the way I want it to.
May I know the right way to host larynx in a different port, if there is one
synesthesiam commented
You should be able to pass --port <PORT>
to the Larynx server command to have it also switch ports internally.
thevickypedia commented
I assume you mean the -p
flag, which when changed has no effect. Please let me know if that's an incorrect assumption.
docker run \
-it \
-p 41823:41823 \
-e "HOME=${HOME}" \
-v "$HOME:${HOME}" \
-v /usr/share/ca-certificates:/usr/share/ca-certificates \
-v /etc/ssl/certs:/etc/ssl/certs \
-w "${PWD}" \
--user "$(id -u):$(id -g)" \
rhasspy/larynx
Unable to find image 'rhasspy/larynx:latest' locally
latest: Pulling from rhasspy/larynx
bb7d5a84853b: Pull complete
9ad3aa2a5208: Pull complete
db8f0f777fdf: Pull complete
2828d5cf47c7: Pull complete
39cb2e9cc81d: Pull complete
9445398469b3: Pull complete
1bda1dfd0fc2: Pull complete
c68801c3b5ff: Pull complete
Digest: sha256:d3dd3ca31cd28a56efb6c99f83f1dda4ed5255f2687ee747d277c48317d1a3ac
Status: Downloaded newer image for rhasspy/larynx:latest
[2022-04-20 02:04:28 +0000] [1] [INFO] Running on http://0.0.0.0:5002 (CTRL + C to quit)
synesthesiam commented
I mean passing a command-line argument to the program inside the container. The HTTP server inside takes a --port <PORT>
argument.
docker run \
-it \
-p 41823:41823 \
-e "HOME=${HOME}" \
-v "$HOME:${HOME}" \
-v /usr/share/ca-certificates:/usr/share/ca-certificates \
-v /etc/ssl/certs:/etc/ssl/certs \
-w "${PWD}" \
--user "$(id -u):$(id -g)" \
rhasspy/larynx --port 41823
thevickypedia commented
That works as expected, thank you. I'm closing this issue now.