imran056 commited on
Commit
c5c2f21
·
verified ·
1 Parent(s): 4145725

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -3
Dockerfile CHANGED
@@ -1,17 +1,32 @@
1
- FROM node:18-alpine
2
 
3
- RUN apk add --no-cache ffmpeg
 
 
 
 
4
 
 
5
  WORKDIR /app
6
 
 
7
  COPY package*.json ./
8
 
 
9
  RUN npm install --production
10
 
11
- COPY . .
 
12
 
 
13
  RUN mkdir -p uploads outputs
14
 
 
15
  EXPOSE 7860
16
 
 
 
 
 
 
17
  CMD ["node", "server.js"]
 
1
+ FROM node:18-slim
2
 
3
+ # Install FFmpeg (REQUIRED for audio processing!)
4
+ RUN apt-get update && \
5
+ apt-get install -y ffmpeg && \
6
+ apt-get clean && \
7
+ rm -rf /var/lib/apt/lists/*
8
 
9
+ # Set working directory
10
  WORKDIR /app
11
 
12
+ # Copy package files
13
  COPY package*.json ./
14
 
15
+ # Install Node.js dependencies
16
  RUN npm install --production
17
 
18
+ # Copy application code
19
+ COPY server.js ./
20
 
21
+ # Create required directories
22
  RUN mkdir -p uploads outputs
23
 
24
+ # Expose port
25
  EXPOSE 7860
26
 
27
+ # Health check
28
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
29
+ CMD node -e "require('http').get('http://localhost:7860/', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
30
+
31
+ # Start the server
32
  CMD ["node", "server.js"]