-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (26 loc) · 1.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Based on: https://nextjs.org/docs/deployment
FROM node:20-alpine
WORKDIR /app
ENV NODE_ENV production
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
# image cache
RUN mkdir -p /app/.next/cache/images && chown nextjs:nodejs /app/.next/cache/images
VOLUME /app/.next/cache/images
USER nextjs
EXPOSE 3000
ENV PORT 3000
# For some reason next.js can't find this by itself. To verify this, see the
# logs for this Docker container whenever an uncached image is requested. If
# sharp is not detected properly, next.js will suggest installing it.
ENV NEXT_SHARP_PATH /app/node_modules/sharp
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
ENV NEXT_TELEMETRY_DISABLED 1
CMD ["node_modules/.bin/next", "start"]
COPY ./.env ./next.config.js ./slicemachine.config.json ./
# TODO: output standalone https://nextjs.org/docs/advanced-features/output-file-tracing
COPY ./node_modules ./node_modules
COPY ./package.json ./package.json
COPY ./public ./public
COPY --chown=nextjs:nodejs ./.next ./.next