Create Dockerfile.frontend
Browse files- Dockerfile.frontend +23 -0
Dockerfile.frontend
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Node runtime as a parent image
|
| 2 |
+
FROM node:18
|
| 3 |
+
|
| 4 |
+
# Install nodemon globally
|
| 5 |
+
RUN npm install -g nodemon
|
| 6 |
+
|
| 7 |
+
# Create a directory for the application
|
| 8 |
+
WORKDIR /app/frontend
|
| 9 |
+
|
| 10 |
+
# Copy package.json and package-lock.json
|
| 11 |
+
COPY frontend/package*.json ./
|
| 12 |
+
|
| 13 |
+
# Install dependencies
|
| 14 |
+
RUN npm install
|
| 15 |
+
|
| 16 |
+
# Copy the rest of the application code
|
| 17 |
+
COPY frontend .
|
| 18 |
+
|
| 19 |
+
# Expose the port
|
| 20 |
+
EXPOSE 5173
|
| 21 |
+
|
| 22 |
+
# Define the command to run the frontend app
|
| 23 |
+
CMD ["npm", "run", "dev"]
|