FROM golang:1.23-alpine AS builder WORKDIR /app RUN apk add --no-cache git ca-certificates COPY go.mod go.sum ./ RUN go mod download -x || (cat go.mod && cat go.sum && exit 1) COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -o zai-proxy . FROM python:3.11-slim WORKDIR /app # Instalar dependencias del sistema para Firefox/Camoufox RUN apt-get update && apt-get install -y wget curl ca-certificates libgtk-3-0 libdbus-glib-1-2 libxt6 libx11-xcb1 xvfb --no-install-recommends && rm -rf /var/lib/apt/lists/* # Instalar Python deps RUN pip install camoufox[geoip] flask --no-cache-dir # Descargar Camoufox browser RUN python3 -m camoufox fetch # Copiar binario Go COPY --from=builder /app/zai-proxy . COPY . . EXPOSE 7860 ENV PORT=7860 CMD ["sh", "-c", "python3 camoufox_server.py > /tmp/camoufox.log 2>&1 & sleep 15 && cat /tmp/camoufox.log && ./zai-proxy"]