Skip to content

Commit

Permalink
[docker] Fix archs once for all
Browse files Browse the repository at this point in the history
  • Loading branch information
WarningImHack3r committed Aug 30, 2023
1 parent 640f82e commit 2ce73e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
with:
context: .
provenance: false
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
ghcr.io/${{ env.REPO }}:${{ env.TAG }}
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build backend
FROM eclipse-temurin:20-jdk-alpine AS build-back
FROM eclipse-temurin:20-jdk-jammy AS build-back

WORKDIR /app

Expand All @@ -23,8 +23,12 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build

# Build final image
FROM eclipse-temurin:20-jre-alpine
RUN apk add nodejs-current
FROM eclipse-temurin:20-jre-jammy
RUN apt update && \
apt install -y curl ca-certificates gnupg && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list && \
apt update && apt install -y nodejs

WORKDIR /app
COPY --from=build-back /app/build/libs/mintstone-backend.jar back/app.jar
Expand Down
4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:20-jdk-alpine AS build
FROM eclipse-temurin:20-jdk-jammy AS build

WORKDIR /app

Expand All @@ -10,7 +10,7 @@ COPY src src

RUN ./gradlew clean build -x test

FROM eclipse-temurin:20-jre-alpine
FROM eclipse-temurin:20-jre-jammy
WORKDIR /app
COPY --from=build /app/build/libs/mintstone-backend.jar app.jar
EXPOSE 8080
Expand Down

0 comments on commit 2ce73e2

Please sign in to comment.