Closed Konders closed 2 years ago
Not reproducible for me when using the current Dockerfile
and the following entrypoint.sh
script:
#!/bin/bash
ALTV_VOICE_SERVER_HOST=${ALTV_VOICE_SERVER_HOST:-"0.0.0.0"}
ALTV_VOICE_SERVER_PLAYER_HOST=${ALTV_VOICE_SERVER_PLAYER_HOST:-"0.0.0.0"}
ALTV_VOICE_SERVER_PLAYER_PORT=${ALTV_VOICE_SERVER_PLAYER_PORT:-"7799"}
ALTV_VOICE_SERVER_PORT=${ALTV_VOICE_SERVER_PORT:-"7798"}
ALTV_VOICE_SERVER_SECRET=${ALTV_VOICE_SERVER_SECRET:-"1234"}
cat <<EOF >/opt/altv/voice.cfg
host: '$ALTV_VOICE_SERVER_HOST'
playerHost: '$ALTV_VOICE_SERVER_PLAYER_HOST'
playerPort: '$ALTV_VOICE_SERVER_PLAYER_PORT'
port: '$ALTV_VOICE_SERVER_PORT'
secret: '$ALTV_VOICE_SERVER_SECRET'
EOF
echo "server started"
./altv-voice-server
Maybe your problem is caused by Docker's caching.
The problem that you may not connect to the voice is because you have to forward the alt:V voice server ports from the Docker container to your host's network like so:
docker run --rm -it -p 7798:7798/udp -p 7799:7799/udp eisengrind/altv-voice-server:release
The problem that you may not connect to the voice is because you have to forward the alt:V voice server ports from the Docker container to your host's network like so:
docker run --rm -it -p 7798:7798/udp -p 7799:7799/udp eisengrind/altv-voice-server:release
Works fine, but when I'm using -d flag(detach), logs of startup are empty
ubuntu@maizen:~$ sudo docker kill voiceserver
voiceserver
ubuntu@maizen:~$ sudo docker rm voiceserver
voiceserver
ubuntu@maizen:~$ sudo docker run --name voiceserver -d --restart=unless-stopped -e ALTV_VOICE_SERVER_SECRET=1234 -p 7798:7798/udp -p 7799:7799/udp eisengrind/altv-voice-server:release-12.10
1a491bf300da7cbef762271188c0ca451c301dc969acce7c6478a2afc51fa2bc
ubuntu@maizen:~$ sudo docker logs 1a491bf300da7cbef762271188c0ca451c301dc969acce7c6478a2afc51fa2bc
(there is must be output of "voice server start bla bla bla"
The problem that you may not connect to the voice is because you have to forward the alt:V voice server ports from the Docker container to your host's network like so:
docker run --rm -it -p 7798:7798/udp -p 7799:7799/udp eisengrind/altv-voice-server:release
Works fine, but when I'm using -d flag(detach), logs of startup are empty
ubuntu@maizen:~$ sudo docker kill voiceserver voiceserver ubuntu@maizen:~$ sudo docker rm voiceserver voiceserver ubuntu@maizen:~$ sudo docker run --name voiceserver -d --restart=unless-stopped -e ALTV_VOICE_SERVER_SECRET=1234 -p 7798:7798/udp -p 7799:7799/udp eisengrind/altv-voice-server:release-12.10 1a491bf300da7cbef762271188c0ca451c301dc969acce7c6478a2afc51fa2bc ubuntu@maizen:~$ sudo docker logs 1a491bf300da7cbef762271188c0ca451c301dc969acce7c6478a2afc51fa2bc
(there is must be output of "voice server start bla bla bla"
You can work around by enabling the TTY mode in Docker. Simply just add the -t
param to your command:
docker run --name voiceserver -t -d --restart=unless-stopped -e ALTV_VOICE_SERVER_SECRET=1234 -p 7798:7798/udp -p 7799:7799/udp eisengrind/altv-voice-server:release-12.10
It might be the case that the alt:V server logs by default to STDOUT instead of logging to TTY output (which I think is needed for Docker logs - again, from my understanding).
Thanks!
if I add echo to entry point, I will see only "server started" but additionally it must print 'Starting voice server on 0.0.0.0:7798' from altv-voice-server
echo 'server started' ./altv-voice-server
atm output "server started"
expected output "server started" "Starting voice server on 0.0.0.0:7798"
Can't connect to voice server from alt server too