fix(docker): make sure the .gitstamp file is properly generated
+ 7
- 3
@@ -39,10 +39,8 @@ RUN yarn test              # Test code to ensure it is regression-free (jest)
 RUN yarn clean             # Cleanup working dir
 RUN yarn build:ts          # Transpile TypeScript to JavaScript (node)
 RUN yarn bundle:islands    # Bundle Islands (react-monolith) to ESM/CJS/UMD
-RUN yarn gitstamp          # Make gitstamp file with built commit hash
 
 COPY ./public              /usr/src/app/public
-COPY ./.gitstamp           /usr/src/app/.gitstamp
 COPY ./app.manifest.json   /usr/src/app/app.manifest.json
 
 FROM node:slim as base

...
@@ -66,11 +64,17 @@ COPY --from=builder /usr/src/app/db             /app/db
 COPY --from=builder /usr/src/app/node_modules   /app/node_modules
 COPY --from=builder /usr/src/app/public         /app/public
 COPY --from=builder /usr/src/app/.env           /app/.env
-COPY --from=builder /usr/src/app/.gitstamp      /app/.gitstamp
 COPY --from=builder /usr/src/app/ReadMe.md      /app/ReadMe.md
 COPY --from=builder /usr/src/app/LICENSE        /app/LICENSE
+COPY --from=builder /usr/src/app/package.json   /app/package.json
 COPY --from=builder /usr/src/app/yarn.lock      /app/yarn.lock
 
+# Generate git stamp file
+COPY --from=builder /usr/src/app/.git           /app/.git
+RUN git rev-parse HEAD > .gitstamp
+COPY ./.gitstamp    /app/.gitstamp
+RUN rm -rf /app/.git
+
 EXPOSE ${PORT}
 
 CMD ["node", "app/server.js"]