LuillY3 commited on
Commit
aefc39f
·
verified ·
1 Parent(s): 939349d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -32
Dockerfile CHANGED
@@ -1,47 +1,30 @@
1
- # Usa la imagen oficial más reciente
2
  FROM evoapicloud/evolution-api AS base
3
 
4
  USER root
5
 
6
- # 1. Instalar dependencias de sistema
7
- RUN apk add --no-cache \
8
- chromium \
9
- nss \
10
- freetype \
11
- harfbuzz \
12
- ca-certificates \
13
- ttf-freefont \
14
- git \
15
- findutils
16
 
17
- # 2. Configurar entorno Chromium
18
  ENV PUPPETEER_SKIP_DOWNLOAD=true
19
  ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
20
  ENV CHROME_BIN=/usr/bin/chromium-browser
21
  ENV CHROME_PATH=/usr/bin/chromium-browser
22
  ENV CHROME_ARGS="--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --disable-gpu --single-process --no-zygote"
23
 
24
- # 3. CIRUGÍA PRECISA: Buscar solo en el directorio de la app
25
- # Cambiamos al directorio raíz para buscar desde ahí pero excluyendo /proc y /sys
26
- WORKDIR /evolution
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- # Este comando busca SOLO en la carpeta actual y sus subcarpetas.
29
- # Si /evolution no es la correcta, buscará en /app u otras comunes si cambiamos el WORKDIR.
30
- # Pero para estar seguros, buscamos en / (root) pero redirigiendo errores al vacío para que no falle el build.
31
- RUN find / -name "fetch-latest-baileys-version.js" -type f 2>/dev/null -exec sh -c 'echo " \
32
- \"use strict\"; \
33
- Object.defineProperty(exports, \"__esModule\", { value: true }); \
34
- exports.fetchLatestBaileysVersion = void 0; \
35
- const fetchLatestBaileysVersion = async (options) => { \
36
- console.log(\"FORZANDO VERSION BAILEYS: 2.3000.1032975692\"); \
37
- return { version: [2, 3000, 1032975692], isLatest: true }; \
38
- }; \
39
- exports.fetchLatestBaileysVersion = fetchLatestBaileysVersion; \
40
- " > {}' \; || true
41
-
42
- # NOTA: El "|| true" al final asegura que si find se queja de permisos, Docker NO cancele el build.
43
-
44
- # 4. Configuración
45
  ENV SERVER_PORT=7860
46
  EXPOSE 7860
47
  ENV DATABASE_ENABLED=true
 
 
1
  FROM evoapicloud/evolution-api AS base
2
 
3
  USER root
4
 
5
+ RUN apk add --no-cache chromium nss freetype harfbuzz ca-certificates ttf-freefont git
 
 
 
 
 
 
 
 
 
6
 
 
7
  ENV PUPPETEER_SKIP_DOWNLOAD=true
8
  ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
9
  ENV CHROME_BIN=/usr/bin/chromium-browser
10
  ENV CHROME_PATH=/usr/bin/chromium-browser
11
  ENV CHROME_ARGS="--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --disable-gpu --single-process --no-zygote"
12
 
13
+ # --- CIRUGÍA ESPECÍFICA ---
14
+ # En lugar de buscar, vamos a crear el archivo en las 2 rutas posibles.
15
+ # Si la carpeta no existe, mkdir -p la crea para evitar errores, aunque sea inútil.
16
+ # Pero lo más probable es que esté en /evolution/node_modules
17
+
18
+ RUN sh -c ' \
19
+ CODE="\"use strict\"; Object.defineProperty(exports, \"__esModule\", { value: true }); exports.fetchLatestBaileysVersion = void 0; const fetchLatestBaileysVersion = async (options) => { console.log(\"FORZANDO VERSION BAILEYS: 2.3000.1032975692\"); return { version: [2, 3000, 1032975692], isLatest: true }; }; exports.fetchLatestBaileysVersion = fetchLatestBaileysVersion;"; \
20
+ \
21
+ TARGET1="/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/fetch-latest-baileys-version.js"; \
22
+ TARGET2="/app/node_modules/@whiskeysockets/baileys/lib/Utils/fetch-latest-baileys-version.js"; \
23
+ \
24
+ if [ -f "$TARGET1" ]; then echo "$CODE" > "$TARGET1" && echo "PARCHE APLICADO EN: $TARGET1"; fi; \
25
+ if [ -f "$TARGET2" ]; then echo "$CODE" > "$TARGET2" && echo "PARCHE APLICADO EN: $TARGET2"; fi; \
26
+ '
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  ENV SERVER_PORT=7860
29
  EXPOSE 7860
30
  ENV DATABASE_ENABLED=true