File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Use an official Node.js runtime as the base image
2
+ FROM node:20-alpine
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the package.json and package-lock.json files
8
+ COPY package*.json ./
9
+
10
+ # Install dependencies
11
+ RUN npm install
12
+
13
+ # Copy the rest of the application code
14
+ COPY . .
15
+
16
+ # Expose the port the app runs on (default is 3000 for Next.js)
17
+ EXPOSE 3000
18
+
19
+ # Start Next.js in development mode with hot-reloading
20
+ CMD ["npm" , "run" , "dev" ]
Original file line number Diff line number Diff line change
1
+ version : " 3"
2
+ services :
3
+ app :
4
+ build :
5
+ context : .
6
+ dockerfile : Dockerfile
7
+ volumes :
8
+ - .:/app
9
+ - /app/node_modules
10
+ ports :
11
+ - " 3000:3000"
12
+ environment :
13
+ - NODE_ENV=development
14
+ command : npm run dev
You can’t perform that action at this time.
0 commit comments