Ikyy commited on
Commit
55db730
·
verified ·
1 Parent(s): 4e78a44

Update Dockerfile

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