NitinBot001 commited on
Commit
96b1477
·
verified ·
1 Parent(s): baaa035

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +46 -27
Dockerfile CHANGED
@@ -1,10 +1,10 @@
1
- FROM devlikeapro/waha:latest
2
 
3
- # Install additional dependencies for Hugging Face Spaces
4
- USER root
5
-
6
- # Set up Chrome/Chromium dependencies and network tools
7
  RUN apt-get update && apt-get install -y \
 
 
 
8
  fonts-liberation \
9
  libasound2 \
10
  libatk-bridge2.0-0 \
@@ -24,36 +24,55 @@ RUN apt-get update && apt-get install -y \
24
  libxkbcommon0 \
25
  libxrandr2 \
26
  xdg-utils \
27
- dnsutils \
28
- iputils-ping \
29
- ca-certificates \
30
  && rm -rf /var/lib/apt/lists/*
31
 
32
- # Update CA certificates
33
- RUN update-ca-certificates
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
- # Hugging Face Spaces specific configurations
36
- ENV WAHA_LOG_LEVEL=debug
37
- ENV WHATSAPP_API_PORT=7860
38
- ENV WHATSAPP_API_HOSTNAME=0.0.0.0
 
39
 
40
- # Chrome/Puppeteer configurations for containerized environment
41
- ENV CHROME_BIN=/usr/bin/chromium
42
- ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
43
- ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
 
44
 
45
- # Disable Chrome sandbox and configure for container networking
46
- ENV CHROME_ARGS="--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer --disable-dev-tools --no-zygote"
 
 
47
 
48
- # DNS configuration
49
- ENV NODE_OPTIONS="--dns-result-order=ipv4first"
 
50
 
51
- # Create directory for sessions persistence
52
- RUN mkdir -p /app/.sessions && chown -R node:node /app/.sessions
53
 
54
- USER node
 
55
 
56
- # Expose port 7860 (required by Hugging Face Spaces)
57
  EXPOSE 7860
58
 
59
- # The base image already has the entrypoint configured
 
 
1
+ FROM node:20-slim
2
 
3
+ # Install dependencies
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ gnupg \
7
+ ca-certificates \
8
  fonts-liberation \
9
  libasound2 \
10
  libatk-bridge2.0-0 \
 
24
  libxkbcommon0 \
25
  libxrandr2 \
26
  xdg-utils \
27
+ git \
 
 
28
  && rm -rf /var/lib/apt/lists/*
29
 
30
+ # Set working directory
31
+ WORKDIR /evolution
32
+
33
+ # Clone Evolution API
34
+ RUN git clone https://github.com/EvolutionAPI/evolution-api.git . && \
35
+ npm install
36
+
37
+ # Hugging Face Spaces configuration
38
+ ENV SERVER_URL=https://0.0.0.0:7860
39
+ ENV PORT=7860
40
+ ENV CORS_ORIGIN=*
41
+ ENV CORS_CREDENTIALS=true
42
+
43
+ # Authentication (change these!)
44
+ ENV AUTHENTICATION_API_KEY=change-me-to-secure-key
45
+ ENV AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
46
 
47
+ # Database configuration (optional - for persistence)
48
+ ENV DATABASE_ENABLED=false
49
+ ENV DATABASE_PROVIDER=postgresql
50
+ ENV DATABASE_CONNECTION_URI=
51
+ ENV DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange
52
 
53
+ # Storage configuration
54
+ ENV STORE_MESSAGES=true
55
+ ENV STORE_MESSAGE_UP=true
56
+ ENV STORE_CONTACTS=true
57
+ ENV STORE_CHATS=true
58
 
59
+ # Log configuration
60
+ ENV LOG_LEVEL=ERROR
61
+ ENV LOG_COLOR=true
62
+ ENV LOG_BAILEYS=error
63
 
64
+ # Disable some features for Hugging Face
65
+ ENV WEBHOOK_GLOBAL_ENABLED=false
66
+ ENV WEBSOCKET_ENABLED=false
67
 
68
+ # Chrome arguments for containerized environment
69
+ ENV CHROME_ARGS=--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-accelerated-2d-canvas,--no-first-run,--no-zygote,--disable-gpu
70
 
71
+ # Create necessary directories
72
+ RUN mkdir -p instances store
73
 
74
+ # Expose port
75
  EXPOSE 7860
76
 
77
+ # Start the application
78
+ CMD ["npm", "run", "start:prod"]