优化部署配置
This commit is contained in:
11
.env.example
11
.env.example
@@ -1,8 +1,9 @@
|
|||||||
# postgres
|
DB_USERNAME=test
|
||||||
DB_USERNAME=
|
DB_PASSWORD=test
|
||||||
DB_PASSWORD=
|
DB_NAME=app
|
||||||
DB_NAME=
|
|
||||||
DB_PORT=5432
|
DB_PORT=5432
|
||||||
|
|
||||||
# redis
|
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
PLATFORM_PORT=8080
|
||||||
|
WEB_PORT=3000
|
||||||
|
|||||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
init.sql
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: lanhu-prod
|
name: lanhu
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -8,7 +8,7 @@ services:
|
|||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||||
POSTGRES_DB: ${DB_NAME}
|
POSTGRES_DB: ${DB_NAME}
|
||||||
ports:
|
ports:
|
||||||
- "localhost:${DB_PORT}:{DB_PORT}"
|
- "127.0.0.1:${DB_PORT}:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
@@ -19,7 +19,7 @@ services:
|
|||||||
redis:
|
redis:
|
||||||
image: redis:7.4
|
image: redis:7.4
|
||||||
ports:
|
ports:
|
||||||
- "localhost:${REDIS_PORT}:{REDIS_PORT}"
|
- "127.0.0.1:${REDIS_PORT}:6379"
|
||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data
|
- redis_data:/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -27,24 +27,28 @@ services:
|
|||||||
driver: local
|
driver: local
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
image: ghcr.io/wyongk/juip-proxy-back:main
|
image: 43.226.58.254:53000/zxf/lanhu-platform:latest
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
- .env.platform
|
- .env.platform
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${PLATFORM_PORT}:8080"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
logging:
|
logging:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: ghcr.io/wyongk/juip-proxy-react:main
|
image: 43.226.58.254:53000/wmp/lanhu-web:latest
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
- .env.web
|
- .env.web
|
||||||
depends_on:
|
depends_on:
|
||||||
- platform
|
- platform
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${WEB_PORT}:3000"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
logging:
|
logging:
|
||||||
driver: local
|
driver: local
|
||||||
|
|||||||
25
startup.sh
Normal file
25
startup.sh
Normal 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
|
||||||
Reference in New Issue
Block a user