mruniquehacker commited on
Commit
8699953
·
verified ·
1 Parent(s): 1bf371c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -26
Dockerfile CHANGED
@@ -1,16 +1,10 @@
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,24 +20,11 @@ RUN yarn install --network-concurrency 1
26
  # Set permissions for app directory
27
  RUN chmod -R 777 /app
28
 
29
- # Create session directory
30
- RUN mkdir -p /app/session && chmod -R 777 /app/session
31
-
32
- # Create a custom resolv.conf in the app directory
33
- RUN echo "nameserver 8.8.8.8\nnameserver 8.8.4.4\nnameserver 1.1.1.1" > /app/resolv.conf
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
- ENV RESOLV_CONF=/app/resolv.conf
43
-
44
- # Add healthcheck
45
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
46
- CMD curl -f http://localhost:7860/ || exit 1
47
 
48
- # Start the bot with DNS checks
49
- CMD ["sh", "-c", "node index.js"]
 
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
  # 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
27
  ENV NODE_ENV=production
 
 
 
 
 
 
 
28
 
29
+ # Start the bot
30
+ CMD ["node", "index.js"]