From 2d4598deab9d8c3bf5dc296a1e5bced8b3759708 Mon Sep 17 00:00:00 2001 From: Daphne Gold Date: Mon, 21 Aug 2023 09:54:36 -0700 Subject: [PATCH] Add mkdir for cache to dockerfile --- frontend/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 7705ad2a9e..24bb0c2d1b 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -59,6 +59,9 @@ RUN npm run build -- --no-lint FROM node:18-bullseye-slim AS release WORKDIR /frontend +RUN mkdir -p /frontend/.next/cache/images/ +VOLUME ["/frontend/.next/cache/images/"] + # Release stage doesn't have a need for `npm`, so remove it to avoid # any vulnerabilities specific to NPM RUN npm uninstall -g npm @@ -68,6 +71,7 @@ RUN rm -rf /opt/yarn-v* # Don't run production as root RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs +RUN chown nextjs:nodejs /frontend/.next/cache/images/ USER nextjs COPY --from=builder /frontend/public ./public