Changed the running command of the Docker container.

This commit is contained in:
2025-03-30 08:06:31 +03:00
parent ebe2c9b493
commit 3d5557d603
5 changed files with 13 additions and 5 deletions

View File

@@ -230,9 +230,9 @@ load_config() {
get_run_command() {
local RUN_COMMAND="docker run -d --name $CONTAINER_NAME"
if [[ $HAS_LOCAL_DBS -eq 1 || $HAS_LOCAL_DBS == "1" ]]; then
RUN_COMMAND+=" --network host"
RUN_COMMAND+=" --env API_HOST=localhost --env API_PORT=${API_PORT:-8080} --network host"
else
RUN_COMMAND+=" -p ${API_PORT:-8080}:8080"
RUN_COMMAND+=" --env API_HOST=0.0.0.0 --env API_PORT=${API_PORT:-8080} -p ${API_PORT:-8080}:8080"
fi
RUN_COMMAND+=" $IMAGE_NAME"
echo $RUN_COMMAND
@@ -664,6 +664,7 @@ main() {
restart) restart;;
status) status ;;
show_config) show_config ;;
update_config) update_config;;
stop) stop ;;
*) echo "Invalid argument: $1"; usage ;;
esac

4
scripts/run.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
uvicorn main:app --host $API_HOST --port $API_PORT

View File

@@ -55,6 +55,6 @@ export PATH="$HOME/.local/bin:$PATH"
source ~/.bashrc
sudo usermod -aG docker $USER
newgrp docker
# Run the manager.sh script with the "install" argument
"$APP_DIR/scripts/manager.sh" install