FROM node:18-alpine WORKDIR /app # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./ RUN \ if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ elif [ -f package-lock.json ]; then npm ci; \ elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ else echo "Lockfile not found." && exit 1; \ fi COPY src ./src COPY public ./public COPY styles ./styles COPY next.config.js . COPY tailwind.config.js . COPY postcss.config.js . COPY theme.config.js . COPY jsconfig.json . # COPY tsconfig.json . # COPY middleware.ts . # Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry # Uncomment the following line to disable telemetry at run time # ENV NEXT_TELEMETRY_DISABLED 1 # Note: Don't expose ports here, Compose will handle that for us # Start Next.js in development mode based on the preferred package manager CMD \ if [ -f yarn.lock ]; then yarn dev; \ elif [ -f package-lock.json ]; then npm run dev; \ elif [ -f pnpm-lock.yaml ]; then pnpm dev; \ else yarn dev; \ fi