Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
.kotlin

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

logs
37 changes: 37 additions & 0 deletions Dockerfile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
# 构建阶段
FROM maven:3.8.6-openjdk-8 AS builder
WORKDIR /build

# 复制pom.xml和依赖文件
COPY pom.xml .
RUN mvn dependency:go-offline -B

# 复制源代码并构建
COPY src ./src
RUN mvn package -DskipTests

# 运行阶段
FROM openjdk:8u252-jre
WORKDIR /app

# 添加非root用户
RUN addgroup --system appgroup && adduser --system appuser --ingroup appgroup

# 复制构建产物
COPY --from=builder /build/target/*.jar app.jar

# 设置权限
RUN chown -R appuser:appgroup /app
USER appuser

# 配置端口(可通过环境变量覆盖)
EXPOSE 8080

# 使用环境变量配置端口和其他参数
# 通过SPRING_PROFILES_ACTIVE可以切换不同环境配置
# 通过SERVER_PORT可以覆盖默认端口8080
# 通过DASHSCOPE_API_KEY可以配置千问API密钥
ENTRYPOINT ["java", "-jar", "app.jar"]
# 注:SpringBoot会自动识别环境变量并映射到配置属性
# SERVER_PORT -> server.port
# DASHSCOPE_API_KEY -> dashscope.api.key
21 changes: 21 additions & 0 deletions LICENSE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2024 AITA Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading