Skip to content
This repository has been archived by the owner on Feb 23, 2025. It is now read-only.

chore: add muti-platform docker image build for aurora-springboot backend. #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
26 changes: 10 additions & 16 deletions .github/workflows/aurora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/checkout@main
with:
java-version: "8"
distribution: "temurin"
cache: "maven"

- name: Build with Maven
run: |
cd aurora-springboot
mvn -B package --file pom.xml

fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@master

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@master

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@master
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@master
with:
platforms: linux/amd64,linux/arm64
push: true
context: aurora-springboot
tags: ${{secrets.DOCKER_USERNAME}}/aurora-springboot:latest
Expand Down
17 changes: 12 additions & 5 deletions aurora-springboot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM openjdk:8
RUN rm -f /etc/localtime \
&& ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
COPY target/aurora-springboot-0.0.1.jar /app/aurora-springboot-0.0.1.jar
FROM maven:3-openjdk-8-slim AS builder
WORKDIR /app

COPY pom.xml ./
RUN mvn dependency:resolve -DskipTests -B

COPY src ./src
RUN mvn clean package -DskipTests -B -T 1C

FROM openjdk:8-jre-alpine
WORKDIR /app
COPY --from=builder /app/target/aurora-springboot-0.0.1.jar /app/aurora-springboot-0.0.1.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app/aurora-springboot-0.0.1.jar","--spring.config.location=/config/application-prod.yml"]
EXPOSE 8080
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ResultVO<?> report() {
}

@ApiOperation(value = "获取系统信息")
@GetMapping("/")
@GetMapping("/info")
public ResultVO<AuroraHomeInfoDTO> getBlogHomeInfo() {
return ResultVO.ok(auroraInfoService.getAuroraHomeInfo());
}
Expand Down
2 changes: 1 addition & 1 deletion aurora-vue/aurora-blog/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default {
})
},
getWebsiteConfig: () => {
return axios.get('/api')
return axios.get('/api/info')
},
qqLogin: (params: any) => {
return axios.post('/api/users/oauth/qq', params)
Expand Down