2
0

优化部署配置

This commit is contained in:
2025-12-20 19:00:20 +08:00
parent da82f77082
commit e2b5608fc5
6 changed files with 1109 additions and 10 deletions

View File

@@ -1,8 +1,9 @@
# postgres
DB_USERNAME=
DB_PASSWORD=
DB_NAME=
DB_USERNAME=test
DB_PASSWORD=test
DB_NAME=app
DB_PORT=5432
# redis
REDIS_PORT=6379
PLATFORM_PORT=8080
WEB_PORT=3000

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.env
.env.*
!.env.example
init.sql

4
README.md Normal file
View File

@@ -0,0 +1,4 @@
1. 拉取项目
2. 配置环境变量
3. 启动项目
4. 填充基础数据client 表)

View File

@@ -1,4 +1,4 @@
name: lanhu-prod
name: lanhu
services:
postgres:
@@ -8,7 +8,7 @@ services:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "localhost:${DB_PORT}:{DB_PORT}"
- "127.0.0.1:${DB_PORT}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
@@ -19,7 +19,7 @@ services:
redis:
image: redis:7.4
ports:
- "localhost:${REDIS_PORT}:{REDIS_PORT}"
- "127.0.0.1:${REDIS_PORT}:6379"
volumes:
- redis_data:/data
restart: unless-stopped
@@ -27,24 +27,28 @@ services:
driver: local
platform:
image: ghcr.io/wyongk/juip-proxy-back:main
image: 43.226.58.254:53000/zxf/lanhu-platform:latest
env_file:
- .env
- .env.platform
depends_on:
- postgres
- redis
ports:
- "127.0.0.1:${PLATFORM_PORT}:8080"
restart: unless-stopped
logging:
driver: local
web:
image: ghcr.io/wyongk/juip-proxy-react:main
image: 43.226.58.254:53000/wmp/lanhu-web:latest
env_file:
- .env
- .env.web
depends_on:
- platform
ports:
- "127.0.0.1:${WEB_PORT}:3000"
restart: unless-stopped
logging:
driver: local

1061
init.sql Normal file

File diff suppressed because it is too large Load Diff

25
startup.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# 检查必要文件
req_files=(
".env"
".env.platform"
# ".env.task"
".env.web"
"init.sql"
)
for i in "${!req_files[@]}"; do
if [ ! -f "${req_files[$i]}" ]; then
echo "缺少必要文件: ${req_files[$i]}"
exit 1
fi
done
# 启动项目
if ! command -v docker &> /dev/null; then
echo "Docker 未安装,请先安装 Docker"
exit 1
fi
# docker compose up -d