Trigger82 commited on
Commit
48cf01c
·
verified ·
1 Parent(s): baf28ec

Update Dockerfile

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