File size: 522 Bytes
d46282f | 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 | FROM node:16.17.0-alpine3.15
RUN apk add --no-cache libc6-compat
RUN npm i -g npm
EXPOSE 3000
ENV PORT 3000
ENV NODE_ENV production
WORKDIR /home/nextjs/app
COPY package.json .
COPY package-lock.json .
RUN npm install --omit=optional
RUN npx browserslist@latest --update-db
RUN npx next telemetry disable
# need to install linux specific swc builds
RUN npm install -D @swc/cli @swc/core
COPY . .
RUN npm run build
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
USER nextjs
CMD [ "npm", "start" ]
|