ChandimaPrabath
commited on
Commit
•
e46f68d
1
Parent(s):
0454be9
fix
Browse files- Dockerfile +10 -7
- frontend/package.json +1 -1
Dockerfile
CHANGED
@@ -14,19 +14,22 @@ RUN npm run build
|
|
14 |
# Install PM2 globally
|
15 |
RUN npm install -g pm2
|
16 |
|
17 |
-
# Stage 2:
|
18 |
-
FROM
|
19 |
|
20 |
-
|
21 |
-
COPY nginx.conf /opt/bitnami/nginx/conf/nginx.conf
|
22 |
|
23 |
-
# Copy the Next.js build from the builder stage
|
24 |
COPY --from=builder /app /app
|
25 |
|
26 |
-
|
|
|
27 |
|
28 |
-
# Expose
|
29 |
EXPOSE 7860
|
30 |
|
|
|
|
|
|
|
31 |
# Start Next.js with PM2
|
32 |
CMD ["pm2-runtime", "start", "npm", "--", "start"]
|
|
|
14 |
# Install PM2 globally
|
15 |
RUN npm install -g pm2
|
16 |
|
17 |
+
# Stage 2: Run the Next.js application with PM2
|
18 |
+
FROM node:20-alpine
|
19 |
|
20 |
+
WORKDIR /app
|
|
|
21 |
|
22 |
+
# Copy the Next.js build and node_modules from the builder stage
|
23 |
COPY --from=builder /app /app
|
24 |
|
25 |
+
# Install PM2 globally
|
26 |
+
RUN npm install -g pm2
|
27 |
|
28 |
+
# Expose port 7860
|
29 |
EXPOSE 7860
|
30 |
|
31 |
+
# Set the PORT environment variable
|
32 |
+
ENV PORT=7860
|
33 |
+
|
34 |
# Start Next.js with PM2
|
35 |
CMD ["pm2-runtime", "start", "npm", "--", "start"]
|
frontend/package.json
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
"scripts": {
|
6 |
"dev": "next dev",
|
7 |
"build": "next build",
|
8 |
-
"start": "next start",
|
9 |
"lint": "next lint"
|
10 |
},
|
11 |
"dependencies": {
|
|
|
5 |
"scripts": {
|
6 |
"dev": "next dev",
|
7 |
"build": "next build",
|
8 |
+
"start": "PORT=7860 next start",
|
9 |
"lint": "next lint"
|
10 |
},
|
11 |
"dependencies": {
|