Skip to content

Commit

Permalink
📝docs: docker compose project name (lobehub#4349)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuozhiyongde authored Oct 13, 2024
1 parent 62cbf1c commit c04afba
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 93 deletions.
20 changes: 11 additions & 9 deletions docker-compose/local/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: lobe-chat-database
services:
network-service:
image: alpine
container_name: lobe-network
ports:
- '${MINIO_PORT}:${MINIO_PORT}' # MinIO API
- '9001:9001' # MinIO Console
- '${MINIO_PORT}:${MINIO_PORT}' # MinIO API
- '9001:9001' # MinIO Console
- '${CASDOOR_PORT}:${CASDOOR_PORT}' # Casdoor
- '${LOBE_PORT}:3210' # LobeChat
command: tail -f /dev/null
Expand All @@ -15,7 +16,7 @@ services:
image: pgvector/pgvector:pg16
container_name: lobe-postgres
ports:
- "5432:5432"
- '5432:5432'
volumes:
- './data:/var/lib/postgresql/data'
environment:
Expand Down Expand Up @@ -44,6 +45,7 @@ services:
command: >
server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
casdoor:
image: casbin/casdoor
container_name: lobe-casdoor
Expand All @@ -53,17 +55,17 @@ services:
postgresql:
condition: service_healthy
environment:
RUNNING_IN_DOCKER: "true"
driverName: "postgres"
dataSourceName: "user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor"
origin: "http://localhost:${CASDOOR_PORT}"
runmode: "dev"
RUNNING_IN_DOCKER: 'true'
driverName: 'postgres'
dataSourceName: 'user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor'
origin: 'http://localhost:${CASDOOR_PORT}'
runmode: 'dev'
volumes:
- ./init_data.json:/init_data.json

lobe:
image: lobehub/lobe-chat-database
container_name: lobe-database
container_name: lobe-chat
network_mode: 'service:network-service'
depends_on:
postgresql:
Expand Down
13 changes: 7 additions & 6 deletions docker-compose/local/logto/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: lobe-chat-database
services:
network-service:
image: alpine
container_name: lobe-network
ports:
- '${MINIO_PORT}:${MINIO_PORT}' # MinIO API
- '9001:9001' # MinIO Console
- '${MINIO_PORT}:${MINIO_PORT}' # MinIO API
- '9001:9001' # MinIO Console
- '${LOGTO_PORT}:${LOGTO_PORT}' # Logto
- '3002:3002' # Logto Admin
- '3002:3002' # Logto Admin
- '${LOBE_PORT}:3210' # LobeChat
command: tail -f /dev/null
networks:
Expand All @@ -16,7 +17,7 @@ services:
image: pgvector/pgvector:pg16
container_name: lobe-postgres
ports:
- "5432:5432"
- '5432:5432'
volumes:
- './data:/var/lib/postgresql/data'
environment:
Expand Down Expand Up @@ -45,6 +46,7 @@ services:
command: >
server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
logto:
image: svhd/logto
container_name: lobe-logto
Expand All @@ -60,10 +62,9 @@ services:
- 'ADMIN_ENDPOINT=http://localhost:3002'
entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']


lobe:
image: lobehub/lobe-chat-database
container_name: lobe-database
container_name: lobe-chat
network_mode: 'service:network-service'
depends_on:
postgresql:
Expand Down
59 changes: 30 additions & 29 deletions docker-compose/local/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# ======================

# 1. Default values of arguments
# Arg: -f
# Arg: -f
# Determine force download asserts, default is not
FORCE_DOWNLOAD=false

Expand All @@ -33,10 +33,12 @@ while getopts "fl:-:" opt; do
-)
case "${OPTARG}" in
lang)
LANGUAGE="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 ))
LANGUAGE="${!OPTIND}"
OPTIND=$(($OPTIND + 1))
;;
url)
SOURCE_URL="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 ))
SOURCE_URL="${!OPTIND}"
OPTIND=$(($OPTIND + 1))
;;
*)
echo "Usage: $0 [-f] [-l language|--lang language] [--url source]" >&2
Expand All @@ -51,7 +53,6 @@ while getopts "fl:-:" opt; do
esac
done


# ===============
# == Variables ==
# ===============
Expand Down Expand Up @@ -161,7 +162,7 @@ show_message() {
;;
esac
;;
esac
esac
}

# Function to download files
Expand All @@ -186,7 +187,7 @@ extract_file() {
if [ $? -eq 0 ]; then
echo "$file_name" $(show_message "extracted_success") "$target_dir"
else
echo "$file_name" $(show_message "extracted_failed")
echo "$file_name" $(show_message "extracted_failed")
exit 1
fi
else
Expand All @@ -198,30 +199,30 @@ extract_file() {
# Define colors
declare -A colors
colors=(
[black]="\e[30m"
[red]="\e[31m"
[green]="\e[32m"
[yellow]="\e[33m"
[blue]="\e[34m"
[magenta]="\e[35m"
[cyan]="\e[36m"
[white]="\e[37m"
[reset]="\e[0m"
[black]="\e[30m"
[red]="\e[31m"
[green]="\e[32m"
[yellow]="\e[33m"
[blue]="\e[34m"
[magenta]="\e[35m"
[cyan]="\e[36m"
[white]="\e[37m"
[reset]="\e[0m"
)

print_centered() {
local text="$1" # Get input texts
local color="${2:-reset}" # Get color, default to reset
local term_width=$(tput cols) # Get terminal width
local text_length=${#text} # Get text length
local padding=$(( (term_width - text_length) / 2 )) # Get padding
# Check if the color is valid
if [[ -z "${colors[$color]}" ]]; then
echo "Invalid color specified. Available colors: ${!colors[@]}"
return 1
fi
# Print the text with padding
printf "%*s${colors[$color]}%s${colors[reset]}\n" $padding "" "$text"
local text="$1" # Get input texts
local color="${2:-reset}" # Get color, default to reset
local term_width=$(tput cols) # Get terminal width
local text_length=${#text} # Get text length
local padding=$(((term_width - text_length) / 2)) # Get padding
# Check if the color is valid
if [[ -z "${colors[$color]}" ]]; then
echo "Invalid color specified. Available colors: ${!colors[@]}"
return 1
fi
# Print the text with padding
printf "%*s${colors[$color]}%s${colors[reset]}\n" $padding "" "$text"
}

# Download files asynchronously
Expand All @@ -236,7 +237,7 @@ rm s3_data.tar.gz

# Display final message
printf "\n%s\n\n" "$(show_message "tips_run_command")"
print_centered "docker compose -p lobechat-starter up -d" "green"
print_centered "docker compose up -d" "green"
printf "\n%s" "$(show_message "tips_show_documentation")"
printf "%s\n" $(show_message "tips_show_documentation_url")
printf "\n\e[33m%s\e[0m\n" "$(show_message "tips_warning")"
printf "\n\e[33m%s\e[0m\n" "$(show_message "tips_warning")"
16 changes: 8 additions & 8 deletions docker-compose/local/zitadel/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: lobe-chat-database
services:
network-service:
image: alpine
container_name: lobe-network
ports:
- '9000:9000' # MinIO API
- '9001:9001' # MinIO Console
- '9000:9000' # MinIO API
- '9001:9001' # MinIO Console
- '8080:8080' # Zitadel Console
- '3210:3210' # LobeChat
command: tail -f /dev/null
Expand All @@ -15,7 +16,7 @@ services:
image: pgvector/pgvector:pg16
container_name: lobe-postgres
ports:
- "5432:5432"
- '5432:5432'
volumes:
- './data:/var/lib/postgresql/data'
environment:
Expand Down Expand Up @@ -44,24 +45,23 @@ services:
command: >
server /etc/minio/data --address ":9000" --console-address ":9001"
zitadel:
restart: 'always'
image: 'ghcr.io/zitadel/zitadel:latest'
container_name: lobe-zitadel
network_mode: 'service:network-service'
command: start-from-init --config /zitadel-config.yaml --steps
/zitadel-init-steps.yaml --masterkey "cft3Tekr/rQBOqwoQSCPoncA9BHbn7QJ"
--tlsMode disabled #MasterkeyNeedsToHave32Characters
command: start-from-init --config /zitadel-config.yaml --steps /zitadel-init-steps.yaml --masterkey "cft3Tekr/rQBOqwoQSCPoncA9BHbn7QJ" --tlsMode disabled #MasterkeyNeedsToHave32Characters
volumes:
- ./zitadel-config.yaml:/zitadel-config.yaml:ro
- ./zitadel-init-steps.yaml:/zitadel-init-steps.yaml:ro
- ./zitadel-init-steps.yaml:/zitadel-init-steps.yaml:ro
depends_on:
postgresql:
condition: service_healthy

lobe:
image: lobehub/lobe-chat-database
container_name: lobe-database
container_name: lobe-chat
network_mode: 'service:network-service'
depends_on:
postgresql:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose/production/logto/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: lobe-chat-database
services:
postgresql:
image: pgvector/pgvector:pg16
Expand Down Expand Up @@ -52,7 +53,7 @@ services:

lobe:
image: lobehub/lobe-chat-database
container_name: lobe-database
container_name: lobe-chat
ports:
- '3210:3210'
depends_on:
Expand Down
10 changes: 5 additions & 5 deletions docker-compose/production/zitadel/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: lobe-chat-database
services:
postgresql:
image: pgvector/pgvector:pg16
Expand Down Expand Up @@ -32,14 +33,13 @@ services:
restart: always
command: >
server /etc/minio/data --address ":9000" --console-address ":9001"
zitadel:
restart: always
image: ghcr.io/zitadel/zitadel:latest
container_name: lobe-zitadel
command: start-from-init --config /zitadel-config.yaml --steps
/zitadel-init-steps.yaml --masterkey "cft3Tekr/rQBOqwoQSCPoncA9BHbn7QJ"
--tlsMode external #MasterkeyNeedsToHave32Characters
command: start-from-init --config /zitadel-config.yaml --steps /zitadel-init-steps.yaml --masterkey "cft3Tekr/rQBOqwoQSCPoncA9BHbn7QJ" --tlsMode external #MasterkeyNeedsToHave32Characters
ports:
- 8080:8080
volumes:
Expand All @@ -51,7 +51,7 @@ services:

lobe:
image: lobehub/lobe-chat-database
container_name: lobe-database
container_name: lobe-chat
ports:
- '3210:3210'
depends_on:
Expand Down
Loading

0 comments on commit c04afba

Please sign in to comment.