Update Dockerfile
Browse files- Dockerfile +2 -11
Dockerfile
CHANGED
|
@@ -1,26 +1,17 @@
|
|
| 1 |
-
# Use an official Node.js image as the base image
|
| 2 |
FROM node:18-alpine
|
| 3 |
|
| 4 |
-
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy package.json and package-lock.json for dependency installation
|
| 8 |
COPY package*.json ./
|
| 9 |
|
| 10 |
-
# Install dependencies
|
| 11 |
RUN npm install
|
| 12 |
|
| 13 |
-
# Ensure the next binary is executable
|
| 14 |
RUN chmod +x node_modules/.bin/next
|
| 15 |
|
| 16 |
-
# Copy the rest of the project files
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
-
# Build the Next.js app
|
| 20 |
RUN npm run build
|
| 21 |
|
| 22 |
-
|
| 23 |
-
EXPOSE 3000
|
| 24 |
|
| 25 |
-
|
| 26 |
-
CMD ["npm", "run", "start"]
|
|
|
|
|
|
|
| 1 |
FROM node:18-alpine
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
COPY package*.json ./
|
| 6 |
|
|
|
|
| 7 |
RUN npm install
|
| 8 |
|
|
|
|
| 9 |
RUN chmod +x node_modules/.bin/next
|
| 10 |
|
|
|
|
| 11 |
COPY . .
|
| 12 |
|
|
|
|
| 13 |
RUN npm run build
|
| 14 |
|
| 15 |
+
EXPOSE 7860
|
|
|
|
| 16 |
|
| 17 |
+
CMD ["npx", "next", "start","-p", "7860"]
|
|
|