tillu-engine / Dockerfile
tillu-AI's picture
Sync files and envs
c9fb523 verified
# TILLU Engine — n8n on HuggingFace Spaces
# ==========================================
# Free hosting: CPU Basic (2 vCPU, 16GB RAM, 50GB disk)
# Database: SQLite (baked into container — workflows copied at build time)
# Timezone: Asia/Kolkata (IST)
#
# HF Space Secrets (Settings → Variables and secrets):
# N8N_ENCRYPTION_KEY — random 32-char hex string
# N8N_BASIC_AUTH_USER — n8n login username
# N8N_BASIC_AUTH_PASSWORD — n8n login password
# TILLU_GATEWAY_URL — https://tillu-backend.onrender.com
# WEBHOOK_URL — https://tillu-ai-tillu-engine.hf.space
# GROQ_API_KEY — Groq API key for LLM nodes
# SUPABASE_URL — Supabase project URL
# SUPABASE_KEY — Supabase service role key
FROM node:20-alpine
USER root
# ── System dependencies ───────────────────────────────────────────────────────
RUN apk add --no-cache \
git \
python3 \
make \
g++ \
build-base \
curl \
wget \
jq \
tzdata
# ── Timezone: IST ─────────────────────────────────────────────────────────────
ENV TZ=Asia/Kolkata
RUN cp /usr/share/zoneinfo/Asia/Kolkata /etc/localtime && \
echo "Asia/Kolkata" > /etc/timezone
# ── n8n install (latest stable) ───────────────────────────────────────────────
RUN npm install -g n8n
# ── n8n data directory ────────────────────────────────────────────────────────
ARG BASE_PATH=/root/.n8n
RUN mkdir -p ${BASE_PATH}/workflows && chmod -R 777 ${BASE_PATH}
# ── Copy TILLU workflows ──────────────────────────────────────────────────────
COPY workflows/ /root/.n8n/workflows/
# ── Copy and enable startup script ───────────────────────────────────────────
COPY start.sh /start.sh
RUN chmod +x /start.sh
# ── n8n configuration ─────────────────────────────────────────────────────────
ENV N8N_PORT=7860
ENV N8N_PROTOCOL=https
ENV N8N_HOST=0.0.0.0
ENV GENERIC_TIMEZONE=Asia/Kolkata
# Task runner (required in newer n8n versions)
ENV N8N_RUNNERS_ENABLED=true
# Allow all built-in and external modules in Code/Function nodes
ENV NODE_FUNCTION_ALLOW_BUILTIN=*
ENV NODE_FUNCTION_ALLOW_EXTERNAL=*
# HF Spaces runs as root — silence the settings permission warning
ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false
# Prune old execution data automatically (keep 7 days)
ENV EXECUTIONS_DATA_PRUNE=true
ENV EXECUTIONS_DATA_MAX_AGE=168
# SQLite — no external DB required; n8n metadata stays local
# TILLU application data lives in Supabase via HTTP nodes
ENV DB_TYPE=sqlite
ENV DB_SQLITE_VACUUM_ON_STARTUP=true
# Auth & telemetry
ENV N8N_BASIC_AUTH_ACTIVE=true
ENV N8N_USER_MANAGEMENT_DISABLED=true
ENV N8N_DIAGNOSTICS_ENABLED=false
ENV N8N_VERSION_NOTIFICATIONS_ENABLED=false
ENV N8N_TEMPLATES_ENABLED=false
# Run executions in the main process (simplest for single-container deploy)
ENV EXECUTIONS_PROCESS=main
WORKDIR /data
EXPOSE 7860
# ── Health check ──────────────────────────────────────────────────────────────
HEALTHCHECK --interval=30s --timeout=15s --start-period=120s --retries=3 \
CMD wget -qO- http://localhost:7860/healthz > /dev/null 2>&1 || exit 1
CMD ["/start.sh"]