File tree Expand file tree Collapse file tree
java/com/halolight/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ CORS_ALLOW_CREDENTIALS=true
1616
1717# Application Configuration
1818APP_NAME = HaloLight
19- PORT = 8080
19+ PORT = 8000
2020SPRING_PROFILES_ACTIVE = dev
2121
2222# Logging
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ HaloLight API Java 是基于 Spring Boot 3.4.1 + Java 23 构建的企业级后
2424
2525``` bash
2626# 开发
27- mvn spring-boot:run # 启动开发服务器(默认 http://localhost:8080 )
27+ mvn spring-boot:run # 启动开发服务器(默认 http://localhost:8000 )
2828mvn spring-boot:run -Dspring-boot.run.profiles=prod # 生产配置启动
2929
3030# 构建
@@ -130,7 +130,7 @@ src/main/java/com/halolight/
130130| ` JWT_REFRESH_EXPIRATION ` | RefreshToken 过期时间(毫秒) | ` 604800000 ` (7天) |
131131| ` CORS_ALLOWED_ORIGINS ` | CORS 允许源(逗号分隔) | ` http://localhost:3000,http://localhost:5173 ` |
132132| ` SPRING_PROFILES_ACTIVE ` | 激活的配置文件 | ` dev ` |
133- | ` PORT ` | 服务端口 | ` 8080 ` |
133+ | ` PORT ` | 服务端口 | ` 8000 ` |
134134
135135支持 ` .env ` 文件配置(通过 spring-dotenv)。
136136
@@ -201,8 +201,8 @@ public void clearCache() { ... }
201201配置前端 API 地址:
202202``` env
203203# Next.js
204- NEXT_PUBLIC_API_URL=http://localhost:8080 /api
204+ NEXT_PUBLIC_API_URL=http://localhost:8000 /api
205205
206206# Vue/Vite
207- VITE_API_URL=http://localhost:8080 /api
207+ VITE_API_URL=http://localhost:8000 /api
208208```
Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ COPY --from=build /app/target/*.jar app.jar
2323
2424# Health check
2525HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
26- CMD curl -f http://localhost:8080 /actuator/health || exit 1
26+ CMD curl -f http://localhost:8000 /actuator/health || exit 1
2727
2828# Expose port
29- EXPOSE 8080
29+ EXPOSE 8000
3030
3131# Run application
3232ENTRYPOINT ["java" , "-jar" , "app.jar" ]
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ fly logs
195195
196196# 检查健康端点
197197fly ssh console
198- wget -O- http://localhost:8080 /actuator/health
198+ wget -O- http://localhost:8000 /actuator/health
199199```
200200
201201### 内存不足(OOMKilled)
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ JWT_SECRET=your-super-secret-jwt-key-change-in-production-min-32-chars
8383SPRING_PROFILES_ACTIVE=dev
8484EOF
8585
86- mvn spring-boot:run # 本地开发,默认 http://localhost:8080
86+ mvn spring-boot:run # 本地开发,默认 http://localhost:8000
8787```
8888
8989生产构建与启动
@@ -98,7 +98,7 @@ java -jar target/halolight-api-java-1.0.0.jar
9898| 变量名 | 说明 | 默认值 |
9999| --------| ------| --------|
100100| ` SPRING_PROFILES_ACTIVE ` | 运行环境 | ` dev ` |
101- | ` PORT ` | 服务端口 | ` 8080 ` |
101+ | ` PORT ` | 服务端口 | ` 8000 ` |
102102| ` DATABASE_URL ` | PostgreSQL 数据库连接 | ` jdbc:postgresql://localhost:5432/halolight ` |
103103| ` DATABASE_USERNAME ` | 数据库用户名 | ` postgres ` |
104104| ` DATABASE_PASSWORD ` | 数据库密码 | ` postgres ` |
@@ -112,7 +112,7 @@ java -jar target/halolight-api-java-1.0.0.jar
112112``` bash
113113# .env 示例
114114SPRING_PROFILES_ACTIVE=prod
115- PORT=8080
115+ PORT=8000
116116DATABASE_URL=jdbc:postgresql://your-host:5432/halolight_db? sslmode=require
117117DATABASE_USERNAME=your_username
118118DATABASE_PASSWORD=your_password
@@ -203,7 +203,7 @@ docker-compose down
203203
204204``` bash
205205docker build -t halolight-api-java .
206- docker run -p 8080:8080 --env-file .env halolight-api-java
206+ docker run -p 8000:8000 --env-file .env halolight-api-java
207207```
208208
209209### 自托管部署
Original file line number Diff line number Diff line change @@ -25,14 +25,14 @@ services:
2525 postgres :
2626 condition : service_healthy
2727 environment :
28- PORT : 8080
28+ PORT : 8000
2929 DATABASE_URL : jdbc:postgresql://postgres:5432/halolight
3030 DATABASE_USERNAME : postgres
3131 DATABASE_PASSWORD : postgres
3232 JWT_SECRET : halolight-secret-key-change-in-production-minimum-256-bits
3333 SPRING_PROFILES_ACTIVE : dev
3434 ports :
35- - " 8080:8080 "
35+ - " 8000:8000 "
3636 restart : unless-stopped
3737
3838volumes :
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ primary_region = 'hkg'
1010 dockerfile = " Dockerfile"
1111
1212[env ]
13- PORT = " 8080 "
13+ PORT = " 8000 "
1414
1515[http_service ]
16- internal_port = 8080
16+ internal_port = 8000
1717 force_https = true
1818 auto_stop_machines = ' suspend'
1919 auto_start_machines = true
Original file line number Diff line number Diff line change 2525 )
2626 ),
2727 servers = {
28- @ Server (url = "http://localhost:8080 " , description = "Local Development Server" ),
28+ @ Server (url = "http://localhost:8000 " , description = "Local Development Server" ),
2929 @ Server (url = "https://api.halolight.com" , description = "Production Server" )
3030 }
3131)
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ spring:
3333 default-property-inclusion : non_null
3434
3535server :
36- port : ${PORT:8080 }
36+ port : ${PORT:8000 }
3737 error :
3838 include-message : always
3939 include-stacktrace : on_param
You can’t perform that action at this time.
0 commit comments