2025-06-22 13:32:57 +02:00
|
|
|
FROM node:18-alpine
|
2025-06-22 23:43:51 +02:00
|
|
|
#RUN addgroup -g 1001 -S docker && adduser -S nextjs -u 1001 -G docker
|
|
|
|
|
RUN addgroup -g 988 -S docker && adduser -S nextjs -u 1001 -G docker
|
2025-06-22 23:16:34 +02:00
|
|
|
USER nextjs
|
2025-06-22 13:32:57 +02:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Copy package files
|
|
|
|
|
COPY package*.json ./
|
2025-06-22 23:10:02 +02:00
|
|
|
RUN npm install --only=production
|
2025-06-22 13:32:57 +02:00
|
|
|
|
|
|
|
|
# Copy app files
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Build the app
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
2025-06-22 23:10:02 +02:00
|
|
|
CMD ["npm", "start"]
|