Skip to content

Commit

Permalink
Add mkdir for cache to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
daphnegold committed Aug 21, 2023
1 parent 87941d6 commit 2d4598d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2d4598d

Please sign in to comment.