From ede2fec79463da93b1d3cf99da749c7c36eab8b8 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 20 Oct 2023 12:00:41 +0100 Subject: [PATCH] add prod build id fetching --- Dockerfile | 3 +++ next.config.js | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f011417..b628af3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,9 @@ COPY --from=builder --chown=nextjs:nodejs /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json COPY --from=builder --chown=nextjs:nodejs /app/next.config.js ./next.config.js +ARG GIT_REV +ENV GIT_REV ${GIT_REV} + USER nextjs EXPOSE 80 ENV HOSTNAME "0.0.0.0" diff --git a/next.config.js b/next.config.js index a0d9835..7282342 100644 --- a/next.config.js +++ b/next.config.js @@ -5,7 +5,8 @@ const nextConfig = { generateEtags: true, compress: true, env: { - NEXT_PUBLIC_BUILD_ID: nextBuildId.sync({ dir: __dirname }), + NEXT_PUBLIC_BUILD_ID: + process.env.GIT_REV || nextBuildId.sync({ dir: __dirname }), }, images: { remotePatterns: [