Neah_Front/Dockerfile
2025-04-08 14:45:23 +02:00

31 lines
603 B
Docker

# Use Node.js 22 as the base image
FROM node:22-alpine
# Set working directory
WORKDIR /application
# Copy package files first
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the application
COPY . .
# Initialize Prisma
RUN npx prisma generate
RUN npx prisma migrate dev --name init
# Build the Next.js application
RUN npm run build
# Expose port 3000
EXPOSE 3000
# Set environment variable
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
# Start the application and keep the container running even if it fails
CMD ["sh", "-c", "npm start || tail -f /dev/null"]