зеркало из
1
0
Форкнуть 0
This commit is contained in:
Julien Dubois 2022-10-05 14:04:44 +02:00
Родитель 848087a4be
Коммит b2262cf8c5
3 изменённых файлов: 25 добавлений и 12 удалений

24
.github/workflows/deploy.yml поставляемый
Просмотреть файл

@ -52,7 +52,7 @@ jobs:
run: |
cd quarkus-app && ./mvnw package
# cd ../micronaut-app && ./mvnw package
# cd ../spring-app && ./mvnw package
cd ../spring-app && ./mvnw package && mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
# end::adocBuild[]
# tag::adocPush[]
@ -72,13 +72,13 @@ jobs:
# file: ./micronaut-app/Dockerfile
# context: ./micronaut-app/
# - name: Build and push Spring container to registry
# uses: docker/build-push-action@v2
# with:
# push: true
# tags: ${{ env.REGISTRY_URL }}/${{ env.PROJECT }}/${{ env.SPRING_APP }}:${{ github.sha }}
# file: ./spring-app/Dockerfile
# context: ./spring-app/
- name: Build and push Spring container to registry
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ env.REGISTRY_URL }}/${{ env.PROJECT }}/${{ env.SPRING_APP }}:${{ github.sha }}
file: ./spring-app/src/main/docker/Dockerfile.jvm
context: ./spring-app/
# end::adocPush[]
# tag::adocDeploy[]
@ -113,8 +113,8 @@ jobs:
# --resource-group ${{ env.RESOURCE_GROUP }} \
# --image ${{ env.REGISTRY_URL }}/${{ env.PROJECT }}/${{ env.MICRONAUT_APP }}:${{ github.sha }}
# az containerapp update \
# --name ${{ env.SPRING_APP }} \
# --resource-group ${{ env.RESOURCE_GROUP }} \
# --image ${{ env.REGISTRY_URL }}/${{ env.PROJECT }}/${{ env.SPRING_APP }}:${{ github.sha }}
az containerapp update \
--name ${{ env.SPRING_APP }} \
--resource-group ${{ env.RESOURCE_GROUP }} \
--image ${{ env.REGISTRY_URL }}/${{ env.PROJECT }}/${{ env.SPRING_APP }}:${{ github.sha }}
# end::adocDeploy[]

Просмотреть файл

@ -62,6 +62,11 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
</configuration>
</plugin>
</plugins>
</build>

Просмотреть файл

@ -0,0 +1,8 @@
FROM --platform=linux/amd64 eclipse-temurin:19-jre-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","io.containerapps.javaruntime.workshop.springboot.SpringbootApplication"]