FlowiseAI / Dockerfile
kivilaid's picture
Update Dockerfile
8f73f4c verified
raw
history blame
1.38 kB
FROM node:20-alpine
USER root
# Set environment variables
ENV PORT=8080
ENV HOST=0.0.0.0
ENV BASE_PATH=/data/.flowise
ENV DATABASE_PATH=/data/.flowise
ENV APIKEY_PATH=/data/.flowise
ENV SECRETKEY_PATH=/data/.flowise
ENV LOG_PATH=/data/.flowise/logs
ENV BLOB_STORAGE_PATH=/data/.flowise/storage
# Install dependencies
RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium curl
ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
ENV NODE_OPTIONS=--max-old-space-size=4096
# Set working directory
WORKDIR /app
# Clone your specific repository
RUN git clone https://github.com/kivilaid/Flowise.git .
# Install pnpm
RUN npm install -g pnpm
# Fix lockfile issues by removing it and letting pnpm generate a new one
RUN rm -f pnpm-lock.yaml
# Install dependencies without lockfile
RUN pnpm install --no-frozen-lockfile
# Build project
RUN pnpm build
# Create necessary directories
RUN mkdir -p /data/.flowise/logs /data/.flowise/storage
RUN chmod -R 777 /data/.flowise
# Set server bin as executable
RUN chmod +x /app/packages/server/bin/run
# Expose port for Hugging Face
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:8080/ || exit 1
# Start command
CMD ["sh", "-c", "cd /app/packages/server/bin && ./run start"]