NeahStable/Dockerfile
2026-01-18 20:38:13 +01:00

35 lines
927 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
# Utiliser npm install pour plus de flexibilité avec les dépendances
RUN npm install --legacy-peer-deps --prefer-offline --no-audit
# Copy the rest of the application
COPY . .
# Initialize Prisma
RUN npx prisma generate
# NOTE: Migrations should be run separately before deployment
# DO NOT use 'migrate dev' in production - it creates new migrations
# Use 'prisma migrate deploy' instead, run separately before container start
# RUN npx prisma migrate deploy
# 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"]