File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Start from the official Node.js LTS image
2
+ FROM node:20-alpine
3
+
4
+ # Set the working directory
5
+ WORKDIR /app
6
+
7
+ # Copy package.json and package-lock.json
8
+ COPY package*.json ./
9
+
10
+ # Install dependencies
11
+ RUN npm install
12
+
13
+ # Copy the rest of your app's source code
14
+ COPY . .
15
+
16
+ # Build the Next.js app
17
+ ARG NEXT_OUTPUT
18
+ RUN npm run build
19
+
20
+ # If we're doing an export, copy all files from the out directory to /static
21
+ # This is a workaround for Next.JS issue https://github.com/vercel/next.js/issues/59988
22
+ RUN if [ "$NEXT_OUTPUT" = "export" ]; then \
23
+ cp -R out/* /static/; \
24
+ fi
25
+
26
+ # Expose the port that your app runs on
27
+ EXPOSE 3000
28
+
29
+ # Start the app
30
+ CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ services:
4
4
# domainname: www.example.xyz # uncomment if you want to use your own domain
5
5
build :
6
6
context : ./app
7
+ dockerfile : Dockerfile
7
8
8
9
ports :
9
10
- target : 3000
You can’t perform that action at this time.
0 commit comments