feat: 完成了docker部署的配置

master
ArgonarioD 2023-07-04 22:51:18 +08:00
parent a2086975f4
commit ed964bc78c
4 changed files with 26 additions and 2 deletions

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM azul/zulu-openjdk-alpine:17-jre-headless-latest
WORKDIR /app
ARG EXTRACTED=build/extracted
COPY ${EXTRACTED}/dependencies ./
COPY ${EXTRACTED}/spring-boot-loader/ ./
COPY ${EXTRACTED}/snapshot-dependencies/ ./
COPY ${EXTRACTED}/application/ ./
VOLUME /app/logs/
ENV ENV prod
EXPOSE 8080
ENTRYPOINT ["java","org.springframework.boot.loader.JarLauncher"]

8
buildDockerImage.ps1 Normal file
View File

@ -0,0 +1,8 @@
.\gradlew.bat bootJar
java -Djarmode=layertools `
-jar .\build\libs\AicsKnowledgeBase_main-1.0.0.jar `
extract --destination build/extracted
docker build -f .\Dockerfile -t auto/aics_main:latest .
pause

View File

@ -12,7 +12,7 @@ sa-token:
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/aics_knowledge?useUnicode=true
url: jdbc:postgresql://db:5432/aics_knowledge?useUnicode=true
username: aics_backend
password: 123456
kafka:

View File

@ -1,3 +1,3 @@
spring:
profiles:
active: prod
active: ${ENV:dev}