增加docker打包服务

This commit is contained in:
BBIT-Kai
2026-06-11 09:45:26 +08:00
parent bf87c09803
commit 0c5f62d201
13 changed files with 4645 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
FROM amazoncorretto:21-alpine
WORKDIR /app
COPY build/install/ticket/ /app/
EXPOSE 8070
CMD ["./bin/ticket"]
+50
View File
@@ -0,0 +1,50 @@
$ErrorActionPreference = "Stop"
$VERSION = "1.0"
$IMAGE = "docker.bbitcn.net/bbit_invoice/server"
Write-Host "Gradle installDist"
Write-Host "==============================="
.\gradlew.bat clean installDist
if ($LASTEXITCODE -ne 0) {
throw "installDist failed"
}
Write-Host "Docker Build"
Write-Host "==============================="
docker build ` -t "${IMAGE}:${VERSION}"`
-t "${IMAGE}:latest" `
.
if ($LASTEXITCODE -ne 0) {
throw "docker build failed"
}
Write-Host "Push Version"
Write-Host "==============================="
docker push "${IMAGE}:${VERSION}"
if ($LASTEXITCODE -ne 0) {
throw "push version failed"
}
Write-Host "Push Latest"
Write-Host "==============================="
docker push "${IMAGE}:latest"
if ($LASTEXITCODE -ne 0) {
throw "push latest failed"
}
Write-Host "SUCCESS"
Write-Host "==============================="
Write-Host ""
Write-Host "Published:"
Write-Host " ${IMAGE}:${VERSION}"
Write-Host " ${IMAGE}:latest"