diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 9a58595..4823e4c 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -7,14 +7,10 @@ FROM base AS deps RUN apk add --no-cache libc6-compat WORKDIR /app -# Install dependencies based on the preferred package manager -COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ -RUN \ - if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ - elif [ -f package-lock.json ]; then npm install && npm ci; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ - else echo "Lockfile not found." && exit 1; \ - fi +# Install dependencies with npm only +COPY package.json package-lock.json ./ +RUN npm install +RUN npm ci # Rebuild the source code only when needed FROM base AS builder @@ -26,13 +22,8 @@ COPY . . ENV NEXT_TELEMETRY_DISABLED=1 ENV NODE_ENV=production -# Build the application -RUN \ - if [ -f yarn.lock ]; then yarn build; \ - elif [ -f package-lock.json ]; then npm run build; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm build; \ - else echo "Lockfile not found." && exit 1; \ - fi +# Build the application using npm only +RUN npm run build # Production image, copy all the files and run next FROM base AS runner