Skip to content

Commit 5438f13

Browse files
committed
fix: 🐛 fix docker build failures
1 parent 7ddab34 commit 5438f13

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.env
1+
node_modules
2+
.next

Dockerfile

+5-18
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
# Use an official Node.js runtime as the base image
2-
FROM node:21.6
3-
4-
# Set the working directory inside the container
1+
FROM node:22.2.0
52
WORKDIR /app
6-
7-
# Copy package.json and package-lock.json to the container
83
COPY package*.json ./
9-
10-
# Clear npm cache (optional)
11-
# Update npm to the latest version (optional)
12-
# Install project dependencies
13-
RUN npm cache clean --force && npm install -g npm@latest && npm install
14-
15-
# Copy the rest of the project files to the container
4+
RUN npm i
165
COPY . .
17-
18-
# Expose any necessary ports (if your application listens on a specific port)
6+
RUN npm run postinstall
7+
RUN npm run build
198
EXPOSE 3000
20-
21-
# Start your application
22-
CMD ["npm", "run", "prod"]
9+
CMD ["npm", "run", "start"]

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
"private": true,
55
"scripts": {
66
"build": "next build",
7-
"dev": "npm run migrate && next dev",
8-
"prod": "npm run postinstall && npm run build && npm run start",
9-
"migrate": "npx prisma db push",
7+
"dev": "next dev",
108
"postinstall": "patch-package && prisma generate",
119
"lint": "next lint",
1210
"lint:fix": "next lint --fix",
13-
"start": "npm run migrate && next start",
11+
"start": "next start",
1412
"test:e2e": "playwright test",
1513
"tsc": "tsc --noEmit --incremental",
1614
"format-rest": "npx prettier --ignore-path .gitignore --write \"**/*.{css,md,json,yml}\" \"!package-lock.json\""

0 commit comments

Comments
 (0)