File size: 1,303 Bytes
5064fae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM node:20-bookworm
USER root

RUN apt-get update && apt-get install -y --no-install-recommends \
    postgresql \
    postgresql-client \
    supervisor \
    curl \
    python3 \
    python3-pip \
    git \
    make \
    g++ \
    ffmpeg \
    graphicsmagick \
    dumb-init \
    openssl \
    && rm -rf /var/lib/apt/lists/*

RUN pip3 install yt-dlp huggingface_hub --break-system-packages

RUN npm install -g n8n@latest

ENV N8N_PORT=7860
ENV N8N_PROTOCOL=https
ENV WEBHOOK_URL=""
ENV N8N_LOG_OUTPUT=console
ENV NODE_FUNCTION_ALLOW_BUILTIN=*
ENV NODE_FUNCTION_ALLOW_EXTERNAL=*
ENV NODE_OPTIONS="--max-old-space-size=4096"
ENV N8N_SECURE_COOKIE=false

ENV DB_TYPE=postgresdb
ENV DB_POSTGRESDB_HOST=localhost
ENV DB_POSTGRESDB_PORT=5432
ENV DB_POSTGRESDB_DATABASE=n8n
ENV DB_POSTGRESDB_USER=n8n
ENV DB_POSTGRESDB_PASSWORD=n8n_secret

ENV N8N_USER_FOLDER=/data/n8n
ENV N8N_ENCRYPTION_KEY=change-me-to-a-random-string

ENV PGDATA=/data/postgres
ENV KEEP_ALIVE_INTERVAL=300
ENV BACKUP_INTERVAL=300

EXPOSE 7860

RUN mkdir -p /data/n8n /data/postgres /data/backups /var/log/supervisor

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY entrypoint.sh /entrypoint.sh
COPY backup.sh /backup.sh
RUN chmod +x /entrypoint.sh /backup.sh

ENTRYPOINT ["dumb-init", "--"]
CMD ["/entrypoint.sh"]