Files
portfolio-2/Dockerfile
Ahmed Al-Taiar 257d56c327
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 49s
docker fix
2025-04-30 22:40:33 -04:00

21 lines
639 B
Docker

FROM node:lts-alpine AS deps
WORKDIR /app
RUN corepack enable && corepack prepare yarn@4.9.1 --activate
COPY package.json yarn.lock .yarnrc.yml ./
RUN yarn install --immutable
FROM node:lts-alpine AS runner
WORKDIR /app
RUN corepack enable && corepack prepare yarn@4.9.1 --activate \
&& addgroup -S nodejs -g 1001 \
&& adduser -S nextjs -u 1001
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/package.json ./package.json
COPY . .
RUN chown -R nextjs:nodejs /app
USER nextjs
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1 \
PORT=3000
EXPOSE 3000
CMD ["sh", "-c", "yarn build && yarn start -p $PORT"]