@@ -3,8 +3,7 @@ FROM node:22-alpine AS base
3
3
FROM base AS installer
4
4
5
5
RUN apk update
6
- RUN apk add --no-cache libc6-compat
7
- RUN apk add --no-cache bash curl
6
+ RUN apk add --no-cache libc6-compat bash curl git go
8
7
9
8
WORKDIR /app
10
9
COPY . .
@@ -24,11 +23,16 @@ ENV NEXT_TELEMETRY_DISABLED=1
24
23
RUN npm ci
25
24
RUN npm run build
26
25
26
+ # Download jwksetinfer tool
27
+ RUN git clone https://github.com/MicahParks/jwkset.git \
28
+ && cd jwkset/cmd/jwksetinfer \
29
+ && go build
30
+
27
31
# Final stage for running the app
28
32
FROM base AS runner
29
33
WORKDIR /app
30
34
31
- RUN apk add --no-cache bash openjdk17-jre
35
+ RUN apk add --no-cache bash openjdk17-jre openssl uuidgen jq
32
36
33
37
# Copy Flyway from the installer stage
34
38
COPY --from=installer /flyway /flyway
@@ -50,11 +54,13 @@ COPY --from=installer /app/package.json .
50
54
COPY --from=installer /app/flyway/conf/flyway.conf ../flyway/conf/flyway.conf
51
55
COPY --from=installer /app/flyway/sql ../flyway/sql
52
56
COPY --from=installer /app/src/app/assets ./.next/server/app/assets
57
+ COPY --from=installer /app/jwkset/cmd/jwksetinfer/jwksetinfer /usr/local/bin/jwksetinfer
53
58
54
59
# Automatically leverage output traces to reduce image size
55
60
COPY --from=installer --chown=nextjs:nodejs /app/.next/standalone ./
56
61
COPY --from=installer --chown=nextjs:nodejs /app/.next/static ./.next/static
57
62
COPY --from=installer --chown=nextjs:nodejs /app/public ./public
63
+ COPY --from=installer --chown=nextjs:nodejs /app/start.sh ./start.sh
58
64
RUN ls -R
59
65
# Set environment variables for Flyway and Node.js telemetry
60
66
ENV NEXT_TELEMETRY_DISABLED=1
@@ -64,4 +70,5 @@ ENV JAVA_HOME=/usr/lib/jvm/default-jvm
64
70
# Add the OpenJDK to the PATH so the java command is available for Flways
65
71
ENV PATH=$JAVA_HOME/bin:$PATH
66
72
67
- CMD ["sh" , "-c" ,"flyway -configFiles=../flyway/conf/flyway.conf -schemas=public -connectRetries=60 migrate && echo done with flyway && node server.js" ]
73
+ ENTRYPOINT ["/bin/bash" ]
74
+ CMD ["/app/start.sh" ]
0 commit comments