diff --git a/Dockerfile b/Dockerfile index 9b1021216..8a3aa86ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,12 +14,12 @@ WORKDIR /openim/openim-server # Copy all files to the container ADD . . -RUN make clean -RUN make build +RUN Bash bootstrap.sh +RUN mage FROM ghcr.io/openim-sigs/openim-ubuntu-image:latest -WORKDIR ${SERVER_WORKDIR} +WORKDIR ${`SERVER_WORKDIR`} # Copy scripts and binary files to the production image COPY --from=builder ${OPENIM_SERVER_BINDIR} /openim/openim-server/_output/bin @@ -27,4 +27,4 @@ COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config COPY --from=builder ${SERVER_WORKDIR}/deployments /openim/openim-server/deployments -CMD ["/openim/openim-server/scripts/docker-start-all.sh"] +CMD ["cd /openim/openim-server/scripts/docker-start-all.sh"] diff --git a/pkg/common/config/load_config_test.go b/pkg/common/config/load_config_test.go index 003b72b27..256214565 100644 --- a/pkg/common/config/load_config_test.go +++ b/pkg/common/config/load_config_test.go @@ -31,8 +31,8 @@ func TestLoadOpenIMRpcUserConfig(t *testing.T) { var user User err := LoadConfig("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", &user) assert.Nil(t, err) - //IMENV_OPENIM_RPC_USER_RPC_LISTENIP + //export IMENV_OPENIM_RPC_USER_RPC_LISTENIP="0.0.0.0" assert.Equal(t, "0.0.0.0", user.RPC.ListenIP) - //export IMENV_OPENIM_RPC_USER_RPC_PORTS='10110,10111,10112' + //export IMENV_OPENIM_RPC_USER_RPC_PORTS="10110,10111,10112" assert.Equal(t, []int{10110, 10111, 10112}, user.RPC.Ports) } diff --git a/scripts/docker-start-all.sh b/scripts/docker-start-all.sh index 8d91cd771..116038b53 100755 --- a/scripts/docker-start-all.sh +++ b/scripts/docker-start-all.sh @@ -21,9 +21,6 @@ #fixme This scripts is the total startup scripts #fixme The full name of the shell scripts that needs to be started is placed in the need_to_start_server_shell array -OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -source "${OPENIM_ROOT}/scripts/install/common.sh" -openim::log::info "\n# Use Docker to start all OpenIM service" -trap 'openim::util::onCtrlC' INT -"${OPENIM_ROOT}"/scripts/start-all.sh 2>&1 & -tail -f ${DOCKER_LOG_FILE} +cd /openim/openim-server +mage start +tail -f /dev/null