├── README.md
├── README.zh-CN.md
├── config
└── ppanel.yaml
├── docker-compose.yml
├── install.sh
├── ppanel-admin-web.yml
├── ppanel-server.yml
├── ppanel-user-web.yml
└── ppanel-web.yml
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
PPanel Quick Deployment Guide
6 |
7 | This is a quick deployment script provided by PPanel
8 |
9 | English · [中文](./README.zh-CN.md)
10 |
11 |
12 |
13 | ### Script Deployment
14 |
15 | Run the following commands to deploy PPanel:
16 |
17 | ```bash
18 | bash <(curl -fsSL https://raw.githubusercontent.com/perfect-panel/ppanel-script/refs/heads/main/install.sh)
19 | ```
20 |
21 | ```bash
22 | bash <(wget -qO- https://raw.githubusercontent.com/perfect-panel/ppanel-script/refs/heads/main/install.sh)
23 | ```
24 |
25 |
26 |
--------------------------------------------------------------------------------
/README.zh-CN.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
PPanel 快速部署指南
6 |
7 | 这是由 PPanel 提供支持的快速部署脚本
8 |
9 | [英文](./README.md) · 中文
10 |
11 |
12 |
13 | ## 脚本部署
14 |
15 | 运行以下命令来部署 PPanel:
16 |
17 | ```sh
18 | bash <(curl -fsSL https://raw.githubusercontent.com/perfect-panel/ppanel-script/refs/heads/main/install.sh)
19 | ```
20 |
21 | ```sh
22 | bash <(wget -qO- https://raw.githubusercontent.com/perfect-panel/ppanel-script/refs/heads/main/install.sh)
23 | ```
24 |
25 |
--------------------------------------------------------------------------------
/config/ppanel.yaml:
--------------------------------------------------------------------------------
1 | Host: 0.0.0.0 # IP address the application will listen on
2 | Port: 8080 # Port for the application
3 | Debug: true # Enable debug mode
4 |
5 | Logger:
6 | File: ./ppanel.log # Log file path
7 | Level: production # Log level: info, debug, error, production
8 |
9 | JwtAuth:
10 | AccessSecret: 333ab3d5-429f-4a51-b001-ef484bf11db7 # Token secret (should be changed)
11 | AccessExpire: 604800 # Token expiration time in seconds
12 |
13 | MySQL:
14 | Addr: mysql_db:3306 # Database address
15 | Dbname: my_database # Database name
16 | Username: root # Database username
17 | Password: rootpassword # Database password
18 | MaxIdleConns: 10 # Maximum idle connections
19 | MaxOpenConns: 10 # Maximum open connections
20 | LogMode: "dev" # Log mode
21 | LogZap: false # Enable Zap logger
22 | Config: charset=utf8mb4&parseTime=true&loc=Asia%2FShanghai # Database config parameters
23 |
24 | Redis:
25 | Host: redis_cache:6379 # Redis server address
26 | Pass: # Redis password (if any)
27 | DB: 0 # Redis database number
28 |
29 | Administer:
30 | Password: password # Admin password (should be changed)
31 | Email: admin@ppanel.dev # Admin email address
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 |
3 | services:
4 | ppanel-server:
5 | image: ppanel/ppanel-server:beta
6 | container_name: ppanel-server-beta
7 | ports:
8 | - '8080:8080'
9 | volumes:
10 | - ./config/ppanel.yaml:/app/etc/ppanel.yaml
11 | restart: always
12 | depends_on:
13 | mysql:
14 | condition: service_healthy
15 | redis:
16 | condition: service_healthy
17 | networks:
18 | - ppanel-network
19 |
20 | mysql:
21 | image: mysql:8.0.23
22 | container_name: mysql_db
23 | restart: always
24 | environment:
25 | MYSQL_ROOT_PASSWORD: rootpassword
26 | MYSQL_DATABASE: my_database
27 | MYSQL_USER: user
28 | MYSQL_PASSWORD: userpassword
29 | ports:
30 | - "3306:3306"
31 | volumes:
32 | - ./docker/mysql:/var/lib/mysql
33 | command: --default-authentication-plugin=mysql_native_password --bind-address=0.0.0.0
34 | healthcheck:
35 | test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-prootpassword"]
36 | interval: 10s
37 | timeout: 5s
38 | retries: 3
39 | networks:
40 | - ppanel-network
41 |
42 | redis:
43 | image: redis:7
44 | container_name: redis_cache
45 | restart: always
46 | ports:
47 | - "6379:6379"
48 | volumes:
49 | - ./docker/redis:/data
50 | healthcheck:
51 | test: ["CMD", "redis-cli", "ping"]
52 | interval: 10s
53 | timeout: 5s
54 | retries: 3
55 | networks:
56 | - ppanel-network
57 |
58 | ppanel-admin-web:
59 | image: ppanel/ppanel-admin-web:latest
60 | container_name: ppanel-admin-web
61 | restart: always
62 | ports:
63 | - '3000:3000'
64 | environment:
65 | # Replace with actual API endpoint if needed
66 | NEXT_PUBLIC_API_URL: https://api.example.com
67 |
68 | ppanel-user-web:
69 | image: ppanel/ppanel-user-web:latest
70 | container_name: ppanel-user-web
71 | restart: always
72 | ports:
73 | - '3001:3000'
74 | environment:
75 | # Replace with actual API endpoint if needed
76 | NEXT_PUBLIC_API_URL: https://api.example.com
77 |
78 | networks:
79 | ppanel-network:
80 | driver: bridge
81 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # ===========================
4 | # PPanel One-Click Deployment Script
5 | # ===========================
6 | # Supports selecting different service combinations for installation,
7 | # automatically sets NEXT_PUBLIC_API_URL (default to server IP + 8080),
8 | # clears other environment variables.
9 | # Prompts user to modify ppanel.yaml and corresponding Docker Compose files
10 | # when deploying the server and one-click deployment.
11 | # Checks if the user is already in the ppanel-script directory.
12 | # Supports English and Chinese prompts.
13 | # Added an "Update services" option that functions similarly to "Restart services".
14 |
15 | # ===========================
16 | # Color Definitions
17 | # ===========================
18 | RED='\033[0;31m'
19 | GREEN='\033[0;32m'
20 | YELLOW='\033[0;33m'
21 | BLUE='\033[0;34m'
22 | CYAN='\033[0;36m'
23 | BOLD='\033[1m'
24 | UNDERLINE='\033[4m'
25 | NC='\033[0m' # No Color
26 |
27 | # ===========================
28 | # Output Functions
29 | # ===========================
30 | log() {
31 | echo -e "$1"
32 | }
33 |
34 | error() {
35 | echo -e "${RED}$1${NC}"
36 | }
37 |
38 | prompt() {
39 | echo -ne "${BOLD}$1${NC}"
40 | }
41 |
42 | info() {
43 | echo -e "${GREEN}$1${NC}"
44 | }
45 |
46 | warning() {
47 | echo -e "${YELLOW}$1${NC}"
48 | }
49 |
50 | bold_echo() {
51 | echo -e "${BOLD}$1${NC}"
52 | }
53 |
54 | # ===========================
55 | # Helper Function: Set NEXT_PUBLIC_API_URL
56 | # ===========================
57 | set_next_public_api_url_in_yml() {
58 | # Default API URL is server IP + 8080 port
59 | DEFAULT_API_URL="http://$SERVER_IP:8080"
60 | if [ "$LANGUAGE" == "CN" ]; then
61 | prompt "请输入 NEXT_PUBLIC_API_URL (默认为:$DEFAULT_API_URL):"
62 | else
63 | prompt "Please enter NEXT_PUBLIC_API_URL (default: $DEFAULT_API_URL): "
64 | fi
65 | read api_url
66 | if [ -z "$api_url" ]; then
67 | api_url="$DEFAULT_API_URL"
68 | if [ "$LANGUAGE" == "CN" ]; then
69 | warning "未输入,使用默认的 NEXT_PUBLIC_API_URL:$api_url"
70 | else
71 | warning "No input detected. Using default NEXT_PUBLIC_API_URL: $api_url"
72 | fi
73 | fi
74 | yml_file=$1
75 |
76 | # Backup the original yml file
77 | cp "$yml_file" "${yml_file}.bak"
78 |
79 | # Create a temporary file
80 | temp_file=$(mktemp)
81 |
82 | # Initialize flag
83 | in_environment_section=0
84 |
85 | while IFS= read -r line || [[ -n "$line" ]]; do
86 | # Check if entering the environment section
87 | if [[ $line =~ ^[[:space:]]*environment: ]]; then
88 | echo "$line" >> "$temp_file"
89 | in_environment_section=1
90 | continue
91 | fi
92 |
93 | # If in the environment section
94 | if [[ $in_environment_section -eq 1 ]]; then
95 | # Check if it's the next top-level key (no indentation)
96 | if [[ $line =~ ^[[:space:]]{0,2}[a-zA-Z0-9_-]+: ]]; then
97 | in_environment_section=0
98 | elif [[ $line =~ ^([[:space:]]*)(NEXT_PUBLIC_API_URL): ]]; then
99 | indentation="${BASH_REMATCH[1]}"
100 | var_name="${BASH_REMATCH[2]}"
101 | # Set NEXT_PUBLIC_API_URL to user-provided value
102 | echo "${indentation}${var_name}: $api_url" >> "$temp_file"
103 | continue
104 | fi
105 | fi
106 |
107 | # Copy other lines
108 | echo "$line" >> "$temp_file"
109 | done < "$yml_file"
110 |
111 | # Replace the original yml file with the modified one
112 | mv "$temp_file" "$yml_file"
113 | }
114 |
115 | # ===========================
116 | # Main Function
117 | # ===========================
118 | main() {
119 | # Display language selection menu
120 | echo -e "${CYAN}==================================================${NC}"
121 | echo -e "${BOLD}Please select your language / 请选择语言:${NC}"
122 | echo -e "${CYAN}==================================================${NC}"
123 | echo -e "1) English"
124 | echo -e "2) 中文"
125 | echo -e "${CYAN}==================================================${NC}"
126 | prompt "Please enter a number (1-2) [1]: "
127 | read lang_choice
128 |
129 | # Default to English if no input
130 | if [ -z "$lang_choice" ]; then
131 | lang_choice=1
132 | fi
133 |
134 | # Set LANGUAGE variable based on user choice
135 | case $lang_choice in
136 | 1)
137 | LANGUAGE="EN"
138 | ;;
139 | 2)
140 | LANGUAGE="CN"
141 | ;;
142 | *)
143 | warning "Invalid selection. Defaulting to English."
144 | LANGUAGE="EN"
145 | ;;
146 | esac
147 |
148 | # Check if running as root
149 | if [ "$EUID" -ne 0 ]; then
150 | if [ "$LANGUAGE" == "CN" ]; then
151 | error "请以 root 用户运行此脚本。"
152 | else
153 | error "Please run this script as root."
154 | fi
155 | exit 1
156 | fi
157 |
158 | # Update system package index
159 | if [ "$LANGUAGE" == "CN" ]; then
160 | info "更新系统包索引..."
161 | else
162 | info "Updating system package index..."
163 | fi
164 | apt-get update -y
165 |
166 | # Install necessary packages
167 | # Check if curl is installed
168 | if command -v curl >/dev/null 2>&1; then
169 | if [ "$LANGUAGE" == "CN" ]; then
170 | warning "检测到 curl 已安装,跳过安装步骤。"
171 | else
172 | warning "curl is already installed. Skipping installation."
173 | fi
174 | else
175 | if [ "$LANGUAGE" == "CN" ]; then
176 | info "正在安装 curl..."
177 | else
178 | info "Installing curl..."
179 | fi
180 | apt-get install -y curl
181 | fi
182 |
183 | # Check if git is installed
184 | if command -v git >/dev/null 2>&1; then
185 | if [ "$LANGUAGE" == "CN" ]; then
186 | warning "检测到 git 已安装,跳过安装步骤。"
187 | else
188 | warning "git is already installed. Skipping installation."
189 | fi
190 | else
191 | if [ "$LANGUAGE" == "CN" ]; then
192 | info "正在安装 git..."
193 | else
194 | info "Installing git..."
195 | fi
196 | apt-get install -y git
197 | fi
198 |
199 | # Check if Docker is installed
200 | if command -v docker >/dev/null 2>&1; then
201 | if [ "$LANGUAGE" == "CN" ]; then
202 | warning "检测到 Docker 已安装,跳过安装步骤。"
203 | else
204 | warning "Docker is already installed. Skipping installation."
205 | fi
206 | else
207 | # Install Docker
208 | if [ "$LANGUAGE" == "CN" ]; then
209 | info "正在安装 Docker..."
210 | else
211 | info "Installing Docker..."
212 | fi
213 | curl -fsSL https://get.docker.com | bash -s -- -y
214 | fi
215 |
216 | # Check if in ppanel-script directory
217 | CURRENT_DIR=${PWD##*/}
218 | if [ "$CURRENT_DIR" != "ppanel-script" ]; then
219 | # Clone PPanel script repository
220 | if [ "$LANGUAGE" == "CN" ]; then
221 | info "正在克隆 PPanel 脚本仓库..."
222 | else
223 | info "Cloning PPanel script repository..."
224 | fi
225 | git clone https://github.com/perfect-panel/ppanel-script.git
226 | cd ppanel-script
227 | else
228 | if [ "$LANGUAGE" == "CN" ]; then
229 | warning "检测到已在 ppanel-script 目录中,跳过克隆步骤。"
230 | else
231 | warning "Detected that you are already in the ppanel-script directory, skipping clone step."
232 | fi
233 | fi
234 |
235 | # Get server IP address
236 | SERVER_IP=$(hostname -I | awk '{print $1}')
237 |
238 | # Display service component selection menu
239 | bold_echo "=================================================="
240 | if [ "$LANGUAGE" == "CN" ]; then
241 | bold_echo "请选择您要执行的操作:"
242 | else
243 | bold_echo "Please select the action you want to perform:"
244 | fi
245 | bold_echo "=================================================="
246 |
247 | if [ "$LANGUAGE" == "CN" ]; then
248 | echo -e "1) 一键部署(全部组件)"
249 | echo -e "2) 部署服务端"
250 | echo -e "3) 部署管理端"
251 | echo -e "4) 部署用户端"
252 | echo -e "5) 部署前端(管理端和用户端)"
253 | echo -e "6) 更新服务"
254 | echo -e "7) 重启服务"
255 | echo -e "8) 查看日志"
256 | echo -e "9) 退出"
257 | else
258 | echo -e "1) One-click deployment (All components)"
259 | echo -e "2) Deploy server"
260 | echo -e "3) Deploy admin dashboard"
261 | echo -e "4) Deploy user dashboard"
262 | echo -e "5) Deploy front-end (Admin and User dashboards)"
263 | echo -e "6) Update services"
264 | echo -e "7) Restart services"
265 | echo -e "8) View logs"
266 | echo -e "9) Exit"
267 | fi
268 | bold_echo "=================================================="
269 |
270 | # Prompt user for selection
271 | if [ "$LANGUAGE" == "CN" ]; then
272 | prompt "请输入一个数字 (1-9) [1]: "
273 | else
274 | prompt "Please enter a number (1-9) [1]: "
275 | fi
276 | read choice
277 |
278 | # If the user does not input, default to 1
279 | if [ -z "$choice" ]; then
280 | choice=1
281 | fi
282 |
283 | # Handle user selection
284 | case $choice in
285 | 1)
286 | if [ "$LANGUAGE" == "CN" ]; then
287 | info "开始一键部署所有组件..."
288 | else
289 | info "Starting one-click deployment of all components..."
290 | fi
291 | # Set NEXT_PUBLIC_API_URL and update related yml files
292 | set_next_public_api_url_in_yml "docker-compose.yml"
293 | # Prompt user to modify configuration files
294 | if [ "$LANGUAGE" == "CN" ]; then
295 | warning "请根据实际需求修改以下配置文件,然后再继续部署:"
296 | echo "- ppanel-script/config/ppanel.yaml"
297 | echo "- ppanel-script/docker-compose.yml"
298 | prompt "修改完成后,按回车键继续... "
299 | else
300 | warning "Please modify the following configuration files according to your needs before continuing:"
301 | echo "- ppanel-script/config/ppanel.yaml"
302 | echo "- ppanel-script/docker-compose.yml"
303 | prompt "After modification, press Enter to continue... "
304 | fi
305 | read
306 | docker compose up -d
307 | ;;
308 | 2)
309 | if [ "$LANGUAGE" == "CN" ]; then
310 | info "开始部署服务端..."
311 | else
312 | info "Starting deployment of the server..."
313 | fi
314 | # Prompt user to modify configuration files
315 | if [ "$LANGUAGE" == "CN" ]; then
316 | warning "请根据实际需求修改以下配置文件,然后再继续部署:"
317 | echo "- ppanel-script/config/ppanel.yaml"
318 | echo "- ppanel-script/ppanel-server.yml"
319 | prompt "修改完成后,按回车键继续... "
320 | else
321 | warning "Please modify the following configuration files according to your needs before continuing:"
322 | echo "- ppanel-script/config/ppanel.yaml"
323 | echo "- ppanel-script/ppanel-server.yml"
324 | prompt "After modification, press Enter to continue... "
325 | fi
326 | read
327 | docker compose -f ppanel-server.yml up -d
328 | ;;
329 | 3)
330 | if [ "$LANGUAGE" == "CN" ]; then
331 | info "开始部署管理端..."
332 | else
333 | info "Starting deployment of the admin dashboard..."
334 | fi
335 | set_next_public_api_url_in_yml "ppanel-admin-web.yml"
336 | # Prompt user to modify configuration files
337 | if [ "$LANGUAGE" == "CN" ]; then
338 | warning "请根据实际需求修改以下配置文件,然后再继续部署:"
339 | echo "- ppanel-script/ppanel-admin-web.yml"
340 | prompt "修改完成后,按回车键继续... "
341 | else
342 | warning "Please modify the following configuration files according to your needs before continuing:"
343 | echo "- ppanel-script/ppanel-admin-web.yml"
344 | prompt "After modification, press Enter to continue... "
345 | fi
346 | read
347 | docker compose -f ppanel-admin-web.yml up -d
348 | ;;
349 | 4)
350 | if [ "$LANGUAGE" == "CN" ]; then
351 | info "开始部署用户端..."
352 | else
353 | info "Starting deployment of the user dashboard..."
354 | fi
355 | set_next_public_api_url_in_yml "ppanel-user-web.yml"
356 | # Prompt user to modify configuration files
357 | if [ "$LANGUAGE" == "CN" ]; then
358 | warning "请根据实际需求修改以下配置文件,然后再继续部署:"
359 | echo "- ppanel-script/ppanel-user-web.yml"
360 | prompt "修改完成后,按回车键继续... "
361 | else
362 | warning "Please modify the following configuration files according to your needs before continuing:"
363 | echo "- ppanel-script/ppanel-user-web.yml"
364 | prompt "After modification, press Enter to continue... "
365 | fi
366 | read
367 | docker compose -f ppanel-user-web.yml up -d
368 | ;;
369 | 5)
370 | if [ "$LANGUAGE" == "CN" ]; then
371 | info "开始部署前端(管理端和用户端)..."
372 | else
373 | info "Starting deployment of the front-end (Admin and User dashboards)..."
374 | fi
375 | set_next_public_api_url_in_yml "ppanel-web.yml"
376 | # Prompt user to modify configuration files
377 | if [ "$LANGUAGE" == "CN" ]; then
378 | warning "请根据实际需求修改以下配置文件,然后再继续部署:"
379 | echo "- ppanel-script/ppanel-web.yml"
380 | prompt "修改完成后,按回车键继续... "
381 | else
382 | warning "Please modify the following configuration files according to your needs before continuing:"
383 | echo "- ppanel-script/ppanel-web.yml"
384 | prompt "After modification, press Enter to continue... "
385 | fi
386 | read
387 | docker compose -f ppanel-web.yml up -d
388 | ;;
389 | 6)
390 | if [ "$LANGUAGE" == "CN" ]; then
391 | info "正在更新正在运行的服务..."
392 | else
393 | info "Updating running services..."
394 | fi
395 | # Get a list of running containers and their compose project names
396 | mapfile -t running_projects < <(docker ps --format '{{.Label "com.docker.compose.project"}}' | sort | uniq)
397 | if [ ${#running_projects[@]} -eq 0 ]; then
398 | if [ "$LANGUAGE" == "CN" ]; then
399 | warning "未检测到正在运行的服务。"
400 | else
401 | warning "No running services detected."
402 | fi
403 | else
404 | for project in "${running_projects[@]}"; do
405 | if [ -z "$project" ]; then
406 | continue
407 | fi
408 | if [ "$LANGUAGE" == "CN" ]; then
409 | info "正在更新项目中的服务:$project"
410 | else
411 | info "Updating services in project: $project"
412 | fi
413 | docker compose -p "$project" pull
414 | docker compose -p "$project" up -d
415 | done
416 | if [ "$LANGUAGE" == "CN" ]; then
417 | info "所有正在运行的服务已更新。"
418 | else
419 | info "All running services have been updated."
420 | fi
421 | fi
422 | ;;
423 | 7)
424 | if [ "$LANGUAGE" == "CN" ]; then
425 | info "正在重启正在运行的服务..."
426 | else
427 | info "Restarting running services..."
428 | fi
429 | # Get a list of running containers and their compose project names
430 | mapfile -t running_projects < <(docker ps --format '{{.Label "com.docker.compose.project"}}' | sort | uniq)
431 | if [ ${#running_projects[@]} -eq 0 ]; then
432 | if [ "$LANGUAGE" == "CN" ]; then
433 | warning "未检测到正在运行的服务。"
434 | else
435 | warning "No running services detected."
436 | fi
437 | else
438 | for project in "${running_projects[@]}"; do
439 | if [ -z "$project" ]; then
440 | continue
441 | fi
442 | if [ "$LANGUAGE" == "CN" ]; then
443 | info "正在重启项目中的服务:$project"
444 | else
445 | info "Restarting services in project: $project"
446 | fi
447 | docker compose -p "$project" restart
448 | done
449 | if [ "$LANGUAGE" == "CN" ]; then
450 | info "所有正在运行的服务已重启。"
451 | else
452 | info "All running services have been restarted."
453 | fi
454 | fi
455 | ;;
456 | 8)
457 | if [ "$LANGUAGE" == "CN" ]; then
458 | info "查看日志..."
459 | warning "您可以按 Ctrl+C 退出日志查看。"
460 | else
461 | info "Viewing logs..."
462 | warning "You can press Ctrl+C to exit log viewing."
463 | fi
464 | docker compose logs -f
465 | ;;
466 | 9)
467 | if [ "$LANGUAGE" == "CN" ]; then
468 | info "退出安装脚本。"
469 | else
470 | info "Exiting the installation script."
471 | fi
472 | exit 0
473 | ;;
474 | *)
475 | if [ "$LANGUAGE" == "CN" ]; then
476 | error "无效的选项,请重新运行脚本并选择正确的数字(1-9)。"
477 | else
478 | error "Invalid option, please rerun the script and select a valid number (1-9)."
479 | fi
480 | exit 1
481 | ;;
482 | esac
483 |
484 | # Deployment completion information (for deployment options)
485 | if [[ "$choice" -ge 1 && "$choice" -le 5 ]]; then
486 | if [ "$LANGUAGE" == "CN" ]; then
487 | info "部署完成!"
488 | else
489 | info "Deployment completed!"
490 | fi
491 |
492 | # Prompt access addresses
493 | echo ""
494 | if [ "$LANGUAGE" == "CN" ]; then
495 | bold_echo "请使用以下地址访问已部署的服务:"
496 | else
497 | bold_echo "Please use the following addresses to access the deployed services:"
498 | fi
499 |
500 | if [ "$choice" == "1" ] || [ "$choice" == "2" ]; then
501 | if [ "$LANGUAGE" == "CN" ]; then
502 | echo -e "服务端(API):${CYAN}http://$SERVER_IP:8080${NC}"
503 | else
504 | echo -e "Server (API): ${CYAN}http://$SERVER_IP:8080${NC}"
505 | fi
506 | fi
507 | if [ "$choice" == "1" ] || [ "$choice" == "3" ]; then
508 | if [ "$LANGUAGE" == "CN" ]; then
509 | echo -e "管理端:${CYAN}http://$SERVER_IP:3000${NC}"
510 | else
511 | echo -e "Admin Dashboard: ${CYAN}http://$SERVER_IP:3000${NC}"
512 | fi
513 | fi
514 | if [ "$choice" == "1" ] || [ "$choice" == "4" ]; then
515 | if [ "$LANGUAGE" == "CN" ]; then
516 | echo -e "用户端:${CYAN}http://$SERVER_IP:3001${NC}"
517 | else
518 | echo -e "User Dashboard: ${CYAN}http://$SERVER_IP:3001${NC}"
519 | fi
520 | fi
521 | if [ "$choice" == "5" ]; then
522 | if [ "$LANGUAGE" == "CN" ]; then
523 | echo -e "管理端:${CYAN}http://$SERVER_IP:3000${NC}"
524 | echo -e "用户端:${CYAN}http://$SERVER_IP:3001${NC}"
525 | else
526 | echo -e "Admin Dashboard: ${CYAN}http://$SERVER_IP:3000${NC}"
527 | echo -e "User Dashboard: ${CYAN}http://$SERVER_IP:3001${NC}"
528 | fi
529 | fi
530 |
531 | # Display default admin account information (only for options 1 or 2)
532 | if [ "$choice" == "1" ] || [ "$choice" == "2" ]; then
533 | echo ""
534 | if [ "$LANGUAGE" == "CN" ]; then
535 | bold_echo "默认管理员账户:"
536 | echo -e "用户名: ${CYAN}admin@ppanel.dev${NC}"
537 | echo -e "密码: ${CYAN}password${NC}"
538 | warning "请在首次登录后及时修改默认密码以确保安全。"
539 | else
540 | bold_echo "Default Admin Account:"
541 | echo -e "Username: ${CYAN}admin@ppanel.dev${NC}"
542 | echo -e "Password: ${CYAN}password${NC}"
543 | warning "Please change the default password after the first login to ensure security."
544 | fi
545 | fi
546 |
547 | # Display service status
548 | echo ""
549 | if [ "$LANGUAGE" == "CN" ]; then
550 | bold_echo "您可以使用以下命令查看服务运行状态:"
551 | else
552 | bold_echo "You can check the service status using the following command:"
553 | fi
554 | echo -e "${CYAN}docker compose ps${NC}"
555 | fi
556 | }
557 |
558 | # ===========================
559 | # Execute the Main Function
560 | # ===========================
561 | main
562 |
--------------------------------------------------------------------------------
/ppanel-admin-web.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | ppanel-admin-web:
5 | image: ppanel/ppanel-admin-web:latest
6 | container_name: ppanel-admin-web
7 | restart: always
8 | ports:
9 | - '3000:3000'
10 | environment:
11 | NEXT_PUBLIC_DEFAULT_LANGUAGE: en-US
12 | NEXT_PUBLIC_SITE_URL: https://example.com
13 | NEXT_PUBLIC_API_URL: https://api.example.com
14 | NEXT_PUBLIC_DEFAULT_USER_EMAIL: user@example.com
15 | NEXT_PUBLIC_DEFAULT_USER_PASSWORD: password123
16 |
--------------------------------------------------------------------------------
/ppanel-server.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 |
3 | services:
4 | ppanel-server:
5 | image: ppanel/ppanel-server:beta
6 | container_name: ppanel-server-beta
7 | ports:
8 | - '8080:8080'
9 | volumes:
10 | - ./config/ppanel.yaml:/app/etc/ppanel.yaml
11 | restart: always
12 | depends_on:
13 | mysql:
14 | condition: service_healthy
15 | redis:
16 | condition: service_healthy
17 | networks:
18 | - ppanel-network
19 |
20 | mysql:
21 | image: mysql:8.0.23
22 | container_name: mysql_db
23 | restart: always
24 | environment:
25 | MYSQL_ROOT_PASSWORD: rootpassword
26 | MYSQL_DATABASE: my_database
27 | MYSQL_USER: user
28 | MYSQL_PASSWORD: userpassword
29 | ports:
30 | - "3306:3306"
31 | volumes:
32 | - ./docker/mysql:/var/lib/mysql
33 | command: --default-authentication-plugin=mysql_native_password --bind-address=0.0.0.0
34 | healthcheck:
35 | test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-prootpassword"]
36 | interval: 10s
37 | timeout: 5s
38 | retries: 3
39 | networks:
40 | - ppanel-network
41 |
42 | redis:
43 | image: redis:7
44 | container_name: redis_cache
45 | restart: always
46 | ports:
47 | - "6379:6379"
48 | volumes:
49 | - ./docker/redis:/data
50 | healthcheck:
51 | test: ["CMD", "redis-cli", "ping"]
52 | interval: 10s
53 | timeout: 5s
54 | retries: 3
55 | networks:
56 | - ppanel-network
57 |
58 | networks:
59 | ppanel-network:
60 | driver: bridge
61 |
--------------------------------------------------------------------------------
/ppanel-user-web.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | ppanel-user-web:
5 | image: ppanel/ppanel-user-web:latest
6 | container_name: ppanel-user-web
7 | restart: always
8 | ports:
9 | - '3001:3000'
10 | environment:
11 | NEXT_PUBLIC_DEFAULT_LANGUAGE: en-US
12 | NEXT_PUBLIC_SITE_URL: https://example.com
13 | NEXT_PUBLIC_API_URL: https://api.example.com
14 | NEXT_PUBLIC_EMAIL: contact@example.com
15 | NEXT_PUBLIC_TELEGRAM_LINK: https://t.me/example
16 | NEXT_PUBLIC_TWITTER_LINK: https://twitter.com/example
17 | NEXT_PUBLIC_DISCORD_LINK: https://discord.com/example
18 | NEXT_PUBLIC_INSTAGRAM_LINK: https://instagram.com/example
19 | NEXT_PUBLIC_LINKEDIN_LINK: https://linkedin.com/example
20 | NEXT_PUBLIC_FACEBOOK_LINK: https://facebook.com/example
21 | NEXT_PUBLIC_GITHUB_LINK: https://github.com/example/repository
22 | NEXT_PUBLIC_DEFAULT_USER_EMAIL: user@example.com
23 | NEXT_PUBLIC_DEFAULT_USER_PASSWORD: password123
--------------------------------------------------------------------------------
/ppanel-web.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | ppanel-admin-web:
5 | image: ppanel/ppanel-admin-web:latest
6 | container_name: ppanel-admin-web
7 | restart: always
8 | ports:
9 | - '3000:3000'
10 | environment:
11 | NEXT_PUBLIC_API_URL: https://api.example.com
12 | ppanel-user-web:
13 | image: ppanel/ppanel-user-web:latest
14 | container_name: ppanel-user-web
15 | restart: always
16 | ports:
17 | - '3001:3000'
18 | environment:
19 | NEXT_PUBLIC_DEFAULT_LANGUAGE: en-US
20 | NEXT_PUBLIC_SITE_URL: https://example.com
21 | NEXT_PUBLIC_API_URL: https://api.example.com
22 | NEXT_PUBLIC_EMAIL: contact@example.com
23 | NEXT_PUBLIC_TELEGRAM_LINK: https://t.me/example
24 | NEXT_PUBLIC_TWITTER_LINK: https://twitter.com/example
25 | NEXT_PUBLIC_DISCORD_LINK: https://discord.com/example
26 | NEXT_PUBLIC_INSTAGRAM_LINK: https://instagram.com/example
27 | NEXT_PUBLIC_LINKEDIN_LINK: https://linkedin.com/example
28 | NEXT_PUBLIC_FACEBOOK_LINK: https://facebook.com/example
29 | NEXT_PUBLIC_GITHUB_LINK: https://github.com/example/repository
30 | NEXT_PUBLIC_DEFAULT_USER_EMAIL: user@example.com
31 | NEXT_PUBLIC_DEFAULT_USER_PASSWORD: password123
32 |
--------------------------------------------------------------------------------