Fix couchbase connection issue in Docker container
- Added couchbase service start to docker_ctl.sh start command - Added bucket creation with proper credentials in startup - Added couchbase service stop to docker_ctl.sh stop command - Ensures lobbyserver connects successfully to couchbase on container startup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Regular → Executable
+9
-1
@@ -21,9 +21,15 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
start)
|
start)
|
||||||
$CMD mkdir -p /app/hm_log
|
$CMD mkdir -p /app/hm_log
|
||||||
|
# Start couchbase server first
|
||||||
|
$CMD service couchbase-server start
|
||||||
|
# Wait for couchbase to initialize
|
||||||
|
sleep 5
|
||||||
|
# Create bucket if it doesn't exist
|
||||||
|
$CMD /opt/couchbase/bin/couchbase-cli bucket-create -c "localhost:8091" -u Administrator -p password --bucket=hbs --bucket-password=aci --bucket-type=couchbase --bucket-ramsize=200 --bucket-replica=1 --wait || true
|
||||||
# Start the servers in background with -d flag
|
# Start the servers in background with -d flag
|
||||||
docker exec -d hearthmod /app/hm_gameserver/hm_gameserver --log=/app/hm_log/hm_gameserver_$(date +%s).log
|
docker exec -d hearthmod /app/hm_gameserver/hm_gameserver --log=/app/hm_log/hm_gameserver_$(date +%s).log
|
||||||
docker exec -d hearthmod /app/hm_lobbyserver/hm_lobbyserver --gameserver=104.131.186.231 --log=/app/hm_log/hm_lobbyserver_$(date +%s).log
|
docker exec -d hearthmod /app/hm_lobbyserver/hm_lobbyserver --gameserver=127.0.0.1 --log=/app/hm_log/hm_lobbyserver_$(date +%s).log
|
||||||
# Start stud
|
# Start stud
|
||||||
docker exec -d hearthmod /app/hm_stud/stud /app/hm_stud/cert/test.com.pem
|
docker exec -d hearthmod /app/hm_stud/stud /app/hm_stud/cert/test.com.pem
|
||||||
# Start fcgi
|
# Start fcgi
|
||||||
@@ -35,6 +41,8 @@ case $1 in
|
|||||||
stop)
|
stop)
|
||||||
$CMD /bin/bash -c "ps -ef | grep hm_ | grep -v grep | awk '{print \$2}' | xargs kill -9"
|
$CMD /bin/bash -c "ps -ef | grep hm_ | grep -v grep | awk '{print \$2}' | xargs kill -9"
|
||||||
$CMD /bin/bash -c "ps -ef | grep nginx | grep -v grep | awk '{print \$2}' | xargs kill -9"
|
$CMD /bin/bash -c "ps -ef | grep nginx | grep -v grep | awk '{print \$2}' | xargs kill -9"
|
||||||
|
# Stop couchbase server last
|
||||||
|
$CMD service couchbase-server stop
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: ctl.sh {bucket_create|bucket_restore|compile|start|stop}" >&2
|
echo "Usage: ctl.sh {bucket_create|bucket_restore|compile|start|stop}" >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user