I'm getting the following error when trying to build my Next.js application in Docker:
Error message
Sign in component
Dockerfile:
FROM node:18-alpine
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build
COPY .next ./.next
EXPOSE 3000
CMD ["npm" "run" "dev"]
docker-compose up --build
version: "3.5"
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: gavel
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules