From d97b532d16d81f0132a340405cd116404ed8ed36 Mon Sep 17 00:00:00 2001 From: ukorvl Date: Sat, 20 Jan 2024 18:41:55 +0400 Subject: [PATCH] remove docker #1 --- .dockerignore | 9 --------- Dockerfile | 39 --------------------------------------- 2 files changed, 48 deletions(-) delete mode 100644 .dockerignore delete mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 81a76b0..0000000 --- a/.dockerignore +++ /dev/null @@ -1,9 +0,0 @@ -Dockerfile -.dockerignore -node_modules -npm-debug.log -README.md -.next -.git -.husky -cypress diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c528f3c..0000000 --- a/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM node:18-alpine AS base - -# Install dependencies only when needed -FROM base AS deps -# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. -RUN apk add --no-cache libc6-compat -WORKDIR /app -COPY package.json package-lock.json ./ -RUN \ - if [ -f package-lock.json ]; then npm ci; \ - else echo "Lockfile not found." && exit 1; \ - fi - - -# Rebuild the source code only when needed -FROM base AS builder -WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules -COPY . . -RUN npm run build - - -# Production image, copy all the files and run next -FROM base AS runner -WORKDIR /app -ENV NODE_ENV production -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 nextjs -COPY --from=builder /app/public ./public -COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ -COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static - -USER nextjs - -EXPOSE 3000 - -ENV PORT 3000 - -CMD ["node", "server.js"]