Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +20 -5
Dockerfile
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
|
|
| 1 |
FROM node:20-alpine AS builder
|
| 2 |
|
|
|
|
| 3 |
RUN apk add --no-cache git python3 make g++
|
| 4 |
|
|
|
|
| 5 |
WORKDIR /evolution
|
| 6 |
-
|
| 7 |
-
# RECUERDA PONER TU URL DEL FORK AQUÍ
|
| 8 |
-
RUN git clone https://github.com/LuillY3/evolution-api.git .
|
| 9 |
RUN git checkout main
|
| 10 |
|
|
|
|
| 11 |
RUN npm install
|
| 12 |
|
| 13 |
-
#
|
|
|
|
|
|
|
| 14 |
RUN echo '"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchLatestBaileysVersion = void 0; const fetchLatestBaileysVersion = async (options) => { console.log("FORZANDO VERSION: 2.3000.1032975692"); return { version: [2, 3000, 1032975692], isLatest: true }; }; exports.fetchLatestBaileysVersion = fetchLatestBaileysVersion;' > ./node_modules/@whiskeysockets/baileys/lib/Utils/fetch-latest-baileys-version.js
|
| 15 |
|
|
|
|
| 16 |
RUN npm run build
|
| 17 |
|
| 18 |
-
# ---
|
| 19 |
FROM node:20-alpine
|
| 20 |
|
| 21 |
USER root
|
|
|
|
| 22 |
RUN apk add --no-cache chromium nss freetype harfbuzz ca-certificates ttf-freefont
|
| 23 |
|
| 24 |
WORKDIR /evolution
|
|
@@ -27,11 +33,20 @@ COPY --from=builder /evolution/node_modules ./node_modules
|
|
| 27 |
COPY --from=builder /evolution/package.json .
|
| 28 |
COPY --from=builder /evolution/public ./public || true
|
| 29 |
|
|
|
|
| 30 |
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
| 31 |
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
| 32 |
ENV CHROME_BIN=/usr/bin/chromium-browser
|
| 33 |
ENV CHROME_ARGS="--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --disable-gpu --single-process --no-zygote"
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
ENV SERVER_PORT=7860
|
| 36 |
EXPOSE 7860
|
|
|
|
| 37 |
CMD ["node", "./dist/src/main.js"]
|
|
|
|
| 1 |
+
# 1. Usamos la imagen base de Node
|
| 2 |
FROM node:20-alpine AS builder
|
| 3 |
|
| 4 |
+
# Instalar herramientas de compilación
|
| 5 |
RUN apk add --no-cache git python3 make g++
|
| 6 |
|
| 7 |
+
# 2. Clonar el Repo Oficial (Rama Main para tener EvoAI)
|
| 8 |
WORKDIR /evolution
|
| 9 |
+
RUN git clone https://github.com/EvolutionAPI/evolution-api.git .
|
|
|
|
|
|
|
| 10 |
RUN git checkout main
|
| 11 |
|
| 12 |
+
# 3. Instalar Dependencias
|
| 13 |
RUN npm install
|
| 14 |
|
| 15 |
+
# 4. PARCHE CRÍTICO PARA WHATSAPP (BAILEYS)
|
| 16 |
+
# Aunque usemos EvoAI, la conexión a WhatsApp sigue siendo Baileys.
|
| 17 |
+
# Este parche asegura que no diga "WhatsApp desactualizado".
|
| 18 |
RUN echo '"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchLatestBaileysVersion = void 0; const fetchLatestBaileysVersion = async (options) => { console.log("FORZANDO VERSION: 2.3000.1032975692"); return { version: [2, 3000, 1032975692], isLatest: true }; }; exports.fetchLatestBaileysVersion = fetchLatestBaileysVersion;' > ./node_modules/@whiskeysockets/baileys/lib/Utils/fetch-latest-baileys-version.js
|
| 19 |
|
| 20 |
+
# 5. Compilar
|
| 21 |
RUN npm run build
|
| 22 |
|
| 23 |
+
# --- IMAGEN FINAL DE PRODUCCIÓN ---
|
| 24 |
FROM node:20-alpine
|
| 25 |
|
| 26 |
USER root
|
| 27 |
+
# Instalar Chromium para Puppeteer (necesario para el QR de Baileys)
|
| 28 |
RUN apk add --no-cache chromium nss freetype harfbuzz ca-certificates ttf-freefont
|
| 29 |
|
| 30 |
WORKDIR /evolution
|
|
|
|
| 33 |
COPY --from=builder /evolution/package.json .
|
| 34 |
COPY --from=builder /evolution/public ./public || true
|
| 35 |
|
| 36 |
+
# Configuración del Navegador (WhatsApp Web)
|
| 37 |
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
| 38 |
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
| 39 |
ENV CHROME_BIN=/usr/bin/chromium-browser
|
| 40 |
ENV CHROME_ARGS="--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --disable-gpu --single-process --no-zygote"
|
| 41 |
|
| 42 |
+
# --- ACTIVAR EL CEREBRO (EVOAI) ---
|
| 43 |
+
# Estas variables habilitan los módulos de IA en el código compilado
|
| 44 |
+
ENV EVOAI_ENABLED=true
|
| 45 |
+
ENV OPENAI_ENABLED=true
|
| 46 |
+
ENV DIFY_ENABLED=true
|
| 47 |
+
|
| 48 |
+
# Puertos
|
| 49 |
ENV SERVER_PORT=7860
|
| 50 |
EXPOSE 7860
|
| 51 |
+
|
| 52 |
CMD ["node", "./dist/src/main.js"]
|