Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
16a2d0cd
"tools/vscode:/vscode.git/clone" did not exist on "83684388fd1efc433e6d64207a24e451e6f4697e"
Commit
16a2d0cd
authored
Dec 24, 2023
by
Daniele Viti
Browse files
added option to specify if build image or not
parent
e2688dc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
run-compose.sh
run-compose.sh
+13
-2
No files found.
run-compose.sh
View file @
16a2d0cd
...
@@ -74,6 +74,7 @@ usage() {
...
@@ -74,6 +74,7 @@ usage() {
echo
" --enable-api[port=PORT] Enable API and expose it on the specified port."
echo
" --enable-api[port=PORT] Enable API and expose it on the specified port."
echo
" --webui[port=PORT] Set the port for the web user interface."
echo
" --webui[port=PORT] Set the port for the web user interface."
echo
" --data[folder=PATH] Bind mount for ollama data folder (by default will create the 'ollama' volume)."
echo
" --data[folder=PATH] Bind mount for ollama data folder (by default will create the 'ollama' volume)."
echo
" --build Build the docker image before running the compose project."
echo
" -q, --quiet Run script in headless mode."
echo
" -q, --quiet Run script in headless mode."
echo
" -h, --help Show this help message."
echo
" -h, --help Show this help message."
echo
""
echo
""
...
@@ -93,6 +94,7 @@ gpu_count=1
...
@@ -93,6 +94,7 @@ gpu_count=1
api_port
=
11435
api_port
=
11435
webui_port
=
3000
webui_port
=
3000
headless
=
false
headless
=
false
build_image
=
false
# Function to extract value from the parameter
# Function to extract value from the parameter
extract_value
()
{
extract_value
()
{
...
@@ -122,6 +124,9 @@ while [[ $# -gt 0 ]]; do
...
@@ -122,6 +124,9 @@ while [[ $# -gt 0 ]]; do
value
=
$(
extract_value
"
$key
"
)
value
=
$(
extract_value
"
$key
"
)
data_dir
=
${
value
:-
"./ollama-data"
}
data_dir
=
${
value
:-
"./ollama-data"
}
;;
;;
--build
)
build_image
=
true
;;
-q
|
--quiet
)
-q
|
--quiet
)
headless
=
true
headless
=
true
;;
;;
...
@@ -164,7 +169,13 @@ if [[ -n $data_dir ]]; then
...
@@ -164,7 +169,13 @@ if [[ -n $data_dir ]]; then
DEFAULT_COMPOSE_COMMAND+
=
" -f docker-compose.data.yaml"
DEFAULT_COMPOSE_COMMAND+
=
" -f docker-compose.data.yaml"
export
OLLAMA_DATA_DIR
=
$data_dir
# Set OLLAMA_DATA_DIR environment variable
export
OLLAMA_DATA_DIR
=
$data_dir
# Set OLLAMA_DATA_DIR environment variable
fi
fi
DEFAULT_COMPOSE_COMMAND+
=
" up -d > /dev/null 2>&1"
DEFAULT_COMPOSE_COMMAND+
=
" up -d"
DEFAULT_COMPOSE_COMMAND+
=
" --remove-orphans"
DEFAULT_COMPOSE_COMMAND+
=
" --force-recreate"
if
[[
-n
$build_image
]]
;
then
DEFAULT_COMPOSE_COMMAND+
=
" --build"
fi
DEFAULT_COMPOSE_COMMAND+
=
" > /dev/null 2>&1"
# Recap of environment variables
# Recap of environment variables
echo
echo
...
@@ -193,7 +204,7 @@ read -n1 -s choice
...
@@ -193,7 +204,7 @@ read -n1 -s choice
if
[[
$choice
==
""
||
$choice
==
"y"
]]
;
then
if
[[
$choice
==
""
||
$choice
==
"y"
]]
;
then
# Execute the command with the current user
# Execute the command with the current user
eval
"
docker compose down > /dev/null 2>&1;
$DEFAULT_COMPOSE_COMMAND
"
&
eval
"
$DEFAULT_COMPOSE_COMMAND
"
&
# Capture the background process PID
# Capture the background process PID
PID
=
$!
PID
=
$!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment