ilhamdev commited on
Commit
39a61f8
·
verified ·
1 Parent(s): f3da77d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -1,12 +1,12 @@
1
  # Use an official Node runtime as a parent image
2
  FROM node:18
3
 
4
- # Create a directory for the application
5
- WORKDIR /app
6
-
7
  # Install nodemon globally
8
  RUN npm install -g nodemon
9
 
 
 
 
10
  # Copy the package.json and package-lock.json for both frontend and backend
11
  COPY frontend/package*.json ./frontend/
12
  COPY backend/package*.json ./backend/
@@ -23,9 +23,15 @@ RUN npm install
23
  WORKDIR /app
24
  COPY . .
25
 
 
 
 
26
  # Expose the ports
27
  EXPOSE 5173
28
  EXPOSE 3000
29
 
 
 
 
30
  # Define the command to run the apps
31
- CMD ["sh", "-c", "npm run dev --prefix /app/frontend & npm run dev --prefix /app/backend"]
 
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
9
+
10
  # Copy the package.json and package-lock.json for both frontend and backend
11
  COPY frontend/package*.json ./frontend/
12
  COPY backend/package*.json ./backend/
 
23
  WORKDIR /app
24
  COPY . .
25
 
26
+ # Ensure the correct permissions for frontend and backend files
27
+ RUN chmod -R 755 /app/frontend /app/backend
28
+
29
  # Expose the ports
30
  EXPOSE 5173
31
  EXPOSE 3000
32
 
33
+ # Define the command to run the apps using nodemon
34
+ CMD ["sh", "-c", "nodemon --watch /app/frontend --exec 'npm run dev --prefix /app/frontend' & nodemon --watch /app/backend --exec 'npm run dev --prefix /app/backend'"]
35
+
36
  # Define the command to run the apps
37
+ # CMD ["sh", "-c", "npm run dev --prefix /app/frontend & npm run dev --prefix /app/backend"]