mruniquehacker commited on
Commit
69a8d02
·
verified ·
1 Parent(s): d8c3827

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -7
Dockerfile CHANGED
@@ -1,10 +1,16 @@
1
  FROM node:lts-buster
2
 
3
- # Install dependencies
4
  RUN apt-get update && \
5
- apt-get install -y ffmpeg webp git && \
6
- apt-get upgrade -y && \
7
- rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
8
 
9
  # Create necessary directories with proper permissions
10
  RUN mkdir -p /tmp/knightbot && \
@@ -20,11 +26,23 @@ RUN yarn install --network-concurrency 1
20
  # Set permissions for app directory
21
  RUN chmod -R 777 /app
22
 
 
 
 
 
 
 
23
  # Expose port for Hugging Face
24
  EXPOSE 7860
25
 
26
- # Set production environment ok s
27
  ENV NODE_ENV=production
 
 
 
 
 
 
28
 
29
- # Start the bot
30
- CMD ["node", "index.js"]
 
1
  FROM node:lts-buster
2
 
3
+ # Install dependencies including dnsutils for debugging
4
  RUN apt-get update && \
5
+ apt-get install -y \
6
+ ffmpeg \
7
+ webp \
8
+ git \
9
+ dnsutils \
10
+ ca-certificates \
11
+ curl \
12
+ && apt-get upgrade -y \
13
+ && rm -rf /var/lib/apt/lists/*
14
 
15
  # Create necessary directories with proper permissions
16
  RUN mkdir -p /tmp/knightbot && \
 
26
  # Set permissions for app directory
27
  RUN chmod -R 777 /app
28
 
29
+ # Add custom DNS resolvers
30
+ RUN echo "nameserver 8.8.8.8\nnameserver 8.8.4.4" > /etc/resolv.conf
31
+
32
+ # Create session directory
33
+ RUN mkdir -p /app/session && chmod -R 777 /app/session
34
+
35
  # Expose port for Hugging Face
36
  EXPOSE 7860
37
 
38
+ # Set environment variables
39
  ENV NODE_ENV=production
40
+ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
41
+ ENV HOSTTYPE=x64
42
+
43
+ # Add healthcheck
44
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
45
+ CMD curl -f http://localhost:7860/ || exit 1
46
 
47
+ # Start the bot with DNS resolution check
48
+ CMD ["sh", "-c", "dig web.whatsapp.com && node index.js"]