NitinBot001 commited on
Commit
655bff0
·
verified ·
1 Parent(s): 8b74440

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -67
Dockerfile CHANGED
@@ -2,78 +2,36 @@ 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 \
11
- libatk1.0-0 \
12
- libatspi2.0-0 \
13
- libcups2 \
14
- libdbus-1-3 \
15
- libdrm2 \
16
- libgbm1 \
17
- libgtk-3-0 \
18
- libnspr4 \
19
- libnss3 \
20
- libwayland-client0 \
21
- libxcomposite1 \
22
- libxdamage1 \
23
- libxfixes3 \
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
- npm run build
37
-
38
- # Hugging Face Spaces configuration
39
- ENV SERVER_URL=https://0.0.0.0:7860
40
- ENV PORT=7860
41
- ENV CORS_ORIGIN=*
42
- ENV CORS_CREDENTIALS=true
43
-
44
- # Authentication (change these!)
45
- ENV AUTHENTICATION_API_KEY=change-me-to-secure-key
46
- ENV AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
47
-
48
- # Database configuration (optional - for persistence)
49
- ENV DATABASE_ENABLED=false
50
- ENV DATABASE_PROVIDER=postgresql
51
- ENV DATABASE_CONNECTION_URI=
52
- ENV DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange
53
-
54
- # Storage configuration
55
- ENV STORE_MESSAGES=true
56
- ENV STORE_MESSAGE_UP=true
57
- ENV STORE_CONTACTS=true
58
- ENV STORE_CHATS=true
59
-
60
- # Log configuration
61
- ENV LOG_LEVEL=ERROR
62
- ENV LOG_COLOR=true
63
- ENV LOG_BAILEYS=error
64
-
65
- # Disable some features for Hugging Face
66
- ENV WEBHOOK_GLOBAL_ENABLED=false
67
- ENV WEBSOCKET_ENABLED=false
68
-
69
- # Chrome arguments for containerized environment
70
- ENV CHROME_ARGS=--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-accelerated-2d-canvas,--no-first-run,--no-zygote,--disable-gpu
71
-
72
- # Create necessary directories
73
- RUN mkdir -p instances store
74
 
75
  # Expose port
76
  EXPOSE 7860
77
 
78
- # Start the application
79
- CMD ["npm", "run", "start:prod"]
 
2
 
3
  # Install dependencies
4
  RUN apt-get update && apt-get install -y \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  git \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
  # Set working directory
9
+ WORKDIR /app
10
+
11
+ # Create package.json
12
+ RUN echo '{ \
13
+ "name": "baileys-server", \
14
+ "version": "1.0.0", \
15
+ "type": "module", \
16
+ "dependencies": { \
17
+ "@whiskeysockets/baileys": "^6.7.8", \
18
+ "express": "^4.18.2", \
19
+ "qrcode-terminal": "^0.12.0", \
20
+ "pino": "^8.16.0" \
21
+ } \
22
+ }' > package.json
23
+
24
+ # Install packages
25
+ RUN npm install
26
+
27
+ # Create server.js
28
+ COPY server.js .
29
+
30
+ # Create auth directory
31
+ RUN mkdir -p auth_info
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  # Expose port
34
  EXPOSE 7860
35
 
36
+ # Start server
37
+ CMD ["node", "server.js"]