Ikyy commited on
Commit
8f03b91
·
verified ·
1 Parent(s): 104f785

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -12
Dockerfile CHANGED
@@ -11,20 +11,17 @@ RUN apt-get update && apt-get install -y \
11
  g++ \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy all files first
15
- COPY . .
16
-
17
- # Install backend dependencies
18
- WORKDIR /app/backend
19
- RUN npm install --omit=dev
20
 
21
- # Install frontend dependencies and build
22
- WORKDIR /app/frontend
23
  RUN npm install
24
- RUN npm run build
25
 
26
- # Back to root
27
- WORKDIR /app
 
 
 
28
 
29
  # Expose port 7860 (required by Hugging Face)
30
  EXPOSE 7860
@@ -34,4 +31,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
34
  CMD node -e "require('http').get('http://localhost:7860/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
35
 
36
  # Start the application
37
- CMD ["node", "/app/backend/server.js"]
 
11
  g++ \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Copy package files
15
+ COPY package.json package-lock.json* ./
 
 
 
 
16
 
17
+ # Install all dependencies
 
18
  RUN npm install
 
19
 
20
+ # Copy all source files
21
+ COPY . .
22
+
23
+ # Build frontend
24
+ RUN npm run build:frontend
25
 
26
  # Expose port 7860 (required by Hugging Face)
27
  EXPOSE 7860
 
31
  CMD node -e "require('http').get('http://localhost:7860/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
32
 
33
  # Start the application
34
+ CMD ["npm", "start"]