Spaces:
Running
Running
File size: 2,001 Bytes
df95a61 1aafa8b df95a61 a545c75 df95a61 691e352 df95a61 691e352 df95a61 1aafa8b a545c75 d02276b df95a61 a545c75 1aafa8b df95a61 ea0b6b2 1aafa8b df95a61 1aafa8b 691e352 a545c75 d02276b 8c9fd51 676c79a d02276b 87f1f98 d02276b 87f1f98 2df783f a545c75 8c9fd51 df95a61 756ed2e a545c75 df95a61 1aafa8b 87f1f98 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | # Utiliser une image Node.js LTS plus récente pour la compatibilité des dépendances
FROM node:20-alpine
# Définir l'utilisateur root pour les permissions
USER root
# Arguments pouvant être passés lors de la construction
ARG FLOWISE_PATH=/usr/local/lib/node_modules/flowise
ARG BASE_PATH=/root/.flowise
ARG DATABASE_PATH=${BASE_PATH}
ARG SECRETKEY_PATH=${BASE_PATH}
ARG LOG_PATH=${BASE_PATH}/logs
ARG BLOB_STORAGE_PATH=${BASE_PATH}/storage
# Installer les dépendances système, y compris les certificats CA pour les connexions SSL
RUN apk add --no-cache ca-certificates git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium
# Mettre à jour les certificats CA
RUN update-ca-certificates
# Variables d'environnement pour Puppeteer
ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Installer Flowise globalement
RUN npm install -g flowise@3.0.10
# Configurer les répertoires de Flowise en utilisant les ARG
RUN mkdir -p ${LOG_PATH} ${FLOWISE_PATH}/uploads && \
chmod -R 777 ${LOG_PATH} ${FLOWISE_PATH}
# --- Variables d'environnement pour la base de données Supabase ---
ENV DATABASE_TYPE=postgres
# Remplacer cette ligne
ENV NODE_TLS_REJECT_UNAUTHORIZED=$NODE_TLS_REJECT_UNAUTHORIZED
# Par ces lignes
ENV PGSSLMODE=require
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
# Variables de connexion (à définir dans les Secrets Hugging Face Space)
ENV DATABASE_HOST=""
ENV DATABASE_PORT="5432"
ENV DATABASE_USER=""
ENV DATABASE_PASSWORD=""
ENV DATABASE_NAME="postgres"
# CRITIQUE: Définir le port pour Hugging Face Spaces
ENV PORT=7860
ENV FLOWISE_USERNAME=$FLOWISE_USERNAME
ENV FLOWISE_PASSWORD=$FLOWISE_PASSWORD
# --- Secret Key Flowise ----
ENV FLOWISE_SECRETKEY_OVERWRITE=$FLOWISE_SECRETKEY_OVERWRITE
# Définir le répertoire de travail
WORKDIR /data
# Exposer le port pour Hugging Face Spaces
EXPOSE 7860
# Commande pour démarrer Flowise sur le port 7860
CMD ["npx", "flowise", "start", "--PORT=7860"] |