FROM node:20-alpine

# Install libc6-compat for compatibility with native node modules
RUN apk add --no-cache libc6-compat

WORKDIR /app

# Expose Next.js port
EXPOSE 3000

ENV PORT 3000
ENV HOSTNAME "0.0.0.0"

# Automatically install dependencies (to handle architecture differences between Windows host and Linux container)
# and run Next.js in development mode
CMD ["sh", "-c", "npm install && npm run dev"]
