Create Dockerfile
Browse files- Dockerfile +24 -0
Dockerfile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Node.js 14 image as base
|
| 2 |
+
FROM node:14-alpine as builder
|
| 3 |
+
|
| 4 |
+
# Set working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy package.json and package-lock.json to install dependencies
|
| 8 |
+
COPY package.json .
|
| 9 |
+
COPY package-lock.json .
|
| 10 |
+
|
| 11 |
+
# Install dependencies
|
| 12 |
+
RUN npm install --production
|
| 13 |
+
|
| 14 |
+
# Copy the rest of the application code
|
| 15 |
+
COPY . .
|
| 16 |
+
|
| 17 |
+
# Build the Next.js project
|
| 18 |
+
RUN npm run build
|
| 19 |
+
|
| 20 |
+
# Expose port 3000
|
| 21 |
+
EXPOSE 3000
|
| 22 |
+
|
| 23 |
+
# Start the Next.js application
|
| 24 |
+
CMD ["npm", "start"]
|