chore(deploy): 本地开发连接远程开发服务器数据库
- 去掉本地 MySQL 容器,直接连 8.148.151.56:3306 - 关闭 Flyway 自动迁移(SPRING_FLYWAY_ENABLED=false),防止本地误跑 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
146923bcdd
commit
0d506cf19c
@ -1,23 +1,6 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mysql:
|
|
||||||
image: mysql:8.0
|
|
||||||
container_name: kg-mysql
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
MYSQL_ROOT_PASSWORD: reading_platform_pwd
|
|
||||||
MYSQL_DATABASE: reading_platform
|
|
||||||
volumes:
|
|
||||||
- mysql_data:/var/lib/mysql
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./reading-platform-java
|
context: ./reading-platform-java
|
||||||
@ -27,12 +10,13 @@ services:
|
|||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
environment:
|
environment:
|
||||||
- SPRING_PROFILES_ACTIVE=prod
|
- SPRING_PROFILES_ACTIVE=prod
|
||||||
|
- SPRING_DATASOURCE_URL=jdbc:mysql://8.148.151.56:3306/reading_platform?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
|
- SPRING_DATASOURCE_USERNAME=root
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=reading_platform_pwd
|
||||||
|
- SPRING_FLYWAY_ENABLED=false
|
||||||
- JWT_SECRET=${JWT_SECRET:-reading-platform-jwt-secret-key-must-be-at-least-256-bits-long}
|
- JWT_SECRET=${JWT_SECRET:-reading-platform-jwt-secret-key-must-be-at-least-256-bits-long}
|
||||||
volumes:
|
volumes:
|
||||||
- uploads_data:/app/uploads
|
- uploads_data:/app/uploads
|
||||||
depends_on:
|
|
||||||
mysql:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
@ -45,5 +29,4 @@ services:
|
|||||||
- backend
|
- backend
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql_data:
|
|
||||||
uploads_data:
|
uploads_data:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user