diff --git a/Dockerfile b/Dockerfile index a3cd71d0..cb41c487 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile # Install dependencies only when needed -FROM node:20-alpine AS deps +FROM node:20-alpine AS ndeps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat WORKDIR /app @@ -11,16 +11,24 @@ WORKDIR /app COPY package.json pnpm-lock.yaml* ./ RUN yarn global add pnpm && pnpm i +FROM gradle:8.1.1-jdk11 AS kdeps +WORKDIR /app +COPY kotlin/gradle/wrapper/gradle-wrapper.properties kotlin/build.gradle.kts kotlin/gradle.properties kotlin/settings.gradle.kts kotlin/gradlew kotlin/gradlew.bat kotlin/kotlin-js-store ./kotlin/ +WORKDIR /app/kotlin +RUN gradle wrap && chmod +x gradlew && ./gradlew assemble + # Rebuild the source code only when needed FROM node:20-bullseye-slim AS builder WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules -COPY . . # Install java11 RUN apt -q update && apt -y -q install --no-install-recommends openjdk-11-jdk-headless +COPY --from=ndeps /app/node_modules ./node_modules +COPY --from=kdeps /app/kotlin/build /app/kotlin/.gradle ./kotlin/ +COPY . . + # Next.js collects completely anonymous telemetry data about general usage. # Learn more here: https://nextjs.org/telemetry # Uncomment the following line in case you want to disable telemetry during the build.