Trigger82 commited on
Commit
8b34763
·
verified ·
1 Parent(s): 6fadebb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -21
Dockerfile CHANGED
@@ -1,37 +1,25 @@
1
  FROM node:23-bookworm
2
 
3
- # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  git \
6
  python3 \
7
  build-essential \
8
- ffmpeg
9
 
10
- # Set environment variables
11
- ENV NODE_ENV=production
12
- ENV MONGO_URI=$MONGO_URI
13
- ENV PORT=7860
14
-
15
- # Create app directory
16
  WORKDIR /app
17
 
18
- # Install Python 2 for node-gyp
19
- RUN ln -s /usr/bin/python3 /usr/bin/python
20
-
21
- # Copy package files
22
  COPY package*.json ./
23
-
24
- # Install dependencies
25
- RUN npm install
26
-
27
- # Copy app source
28
  COPY . .
29
 
30
- # Create persistent storage directory
31
- RUN mkdir -p /persistent/storage && chmod -R 777 /persistent
32
 
33
- # Expose port
34
  EXPOSE 7860
35
 
36
- # Start application
 
 
 
37
  CMD ["node", "server.js"]
 
1
  FROM node:23-bookworm
2
 
3
+ # Install critical dependencies
4
  RUN apt-get update && apt-get install -y \
5
  git \
6
  python3 \
7
  build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
 
 
 
 
 
 
10
  WORKDIR /app
11
 
 
 
 
 
12
  COPY package*.json ./
13
+ RUN npm install --omit=dev
 
 
 
 
14
  COPY . .
15
 
16
+ # Ensure writable directories
17
+ RUN mkdir -p /app/storage && chmod -R 777 /app/storage
18
 
 
19
  EXPOSE 7860
20
 
21
+ # Health check
22
+ HEALTHCHECK --interval=30s --timeout=3s \
23
+ CMD curl -f http://localhost:7860 || exit 1
24
+
25
  CMD ["node", "server.js"]