forked from open-webui/open-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-run.sh
More file actions
executable file
·32 lines (25 loc) · 948 Bytes
/
docker-run.sh
File metadata and controls
executable file
·32 lines (25 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
set -euo pipefail
# ---------------------------------------------------------------------------
# Build and run the Open WebUI Docker container locally.
# ---------------------------------------------------------------------------
readonly IMAGE="open-webui"
readonly CONTAINER="open-webui"
readonly HOST_PORT="${OPEN_WEBUI_PORT:-3000}"
readonly CONTAINER_PORT=8080
echo "Building ${IMAGE} image..."
docker build -t "$IMAGE" .
echo "Stopping any existing ${CONTAINER} container..."
docker stop "$CONTAINER" 2>/dev/null || true
docker rm "$CONTAINER" 2>/dev/null || true
echo "Starting ${CONTAINER}..."
docker run -d \
-p "${HOST_PORT}:${CONTAINER_PORT}" \
--add-host=host.docker.internal:host-gateway \
-v "${IMAGE}:/app/backend/data" \
--name "$CONTAINER" \
--restart always \
"$IMAGE"
echo "Cleaning up dangling images..."
docker image prune -f
echo "Open WebUI is running at http://localhost:${HOST_PORT}"