Skip to content

Commit

Permalink
enhance: support extra options for docker mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aronchanisme committed Oct 25, 2023
1 parent 3070b8a commit 407363a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ function start()

# host data path
mkdir -p ${MO_CONTAINER_DATA_HOST_PATH}

if [[ "${MO_CONTAINER_EXTRA_MOUNT_OPTION}" != "" ]]; then
cmd_params="-d -v ${MO_CONTAINER_EXTRA_MOUNT_OPTION} -v ${MO_CONTAINER_DATA_HOST_PATH}:/mo-data:rw -p ${MO_DEBUG_PORT}:${MO_CONTAINER_DEBUG_PORT} -p ${MO_PORT}:${MO_CONTAINER_PORT} --name ${MO_CONTAINER_NAME}"
else
cmd_params="-d -v ${MO_CONTAINER_DATA_HOST_PATH}:/mo-data:rw -p ${MO_DEBUG_PORT}:${MO_CONTAINER_DEBUG_PORT} -p ${MO_PORT}:${MO_CONTAINER_PORT} --name ${MO_CONTAINER_NAME}"
fi

cmd_params="-d -v ${MO_CONTAINER_DATA_HOST_PATH}:/mo-data:rw -p ${MO_DEBUG_PORT}:${MO_CONTAINER_DEBUG_PORT} -p ${MO_PORT}:${MO_CONTAINER_PORT} --name ${MO_CONTAINER_NAME}"
docker_init_cmd="docker run"



if [[ "${total_mem}" != "" ]]; then
let docker_mem_limit=total_mem*${MO_CONTAINER_MEMORY_RATIO}/100
let go_mem_limit=docker_mem_limit*${GO_MEM_LIMIT_RATIO}/100
Expand Down Expand Up @@ -83,6 +90,8 @@ function start()
docker_init_cmd="docker run ${cmd_params} ${MO_IMAGE_FULL}"
fi



#docker_init_cmd="${docker_init_cmd} --hostname ${MO_CONTAINER_HOSTNAME} -v ${MO_CONTAINER_DATA_HOST_PATH}:/mo-data:rw -v ${MO_CONTAINER_CONF_HOST_PATH}:/etc:rw --entrypoint /mo-service ${MO_IMAGE_FULL} -launch ${MO_CONTAINER_CONF_CON_FILE}"


Expand Down
1 change: 1 addition & 0 deletions conf/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ MO_CONTAINER_CONF_CON_FILE="/etc/quickstart/launch.toml"
MO_CONTAINER_DATA_HOST_PATH="/data/mo/"
MO_CONTAINER_HOSTNAME="705203be8a9e"
MO_CONTAINER_MEMORY_RATIO=90
MO_CONTAINER_EXTRA_MOUNT_OPTION=""

###########################################
# no need to set below conf for most cases
Expand Down
1 change: 1 addition & 0 deletions conf/env.sh.default
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ MO_CONTAINER_CONF_CON_FILE="/etc/quickstart/launch.toml"
MO_CONTAINER_DATA_HOST_PATH="/data/mo/"
MO_CONTAINER_HOSTNAME="705203be8a9e"
MO_CONTAINER_MEMORY_RATIO=90
MO_CONTAINER_EXTRA_MOUNT_OPTION=""

###########################################
# no need to set below conf for most cases
Expand Down

0 comments on commit 407363a

Please sign in to comment.