Yussuy commited on
Commit
3614979
·
verified ·
1 Parent(s): 4f6c2f2

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +59 -0
Dockerfile ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:24-alpine
2
+
3
+ # Set user to root for installation
4
+ USER root
5
+
6
+ # Arguments that can be passed at build time
7
+ ARG N8N_PATH=/usr/local/lib/node_modules/n8n
8
+ ARG BASE_PATH=/root/.n8n
9
+ ARG DATABASE_PATH=$BASE_PATH/database
10
+ ARG CONFIG_PATH=$BASE_PATH/config
11
+ ARG WORKFLOWS_PATH=$BASE_PATH/workflows
12
+ ARG LOGS_PATH=$BASE_PATH/logs
13
+
14
+ # Install system dependencies (for Web automation, databases, video processing)
15
+ RUN apk add --no-cache \
16
+ git \
17
+ python3 \
18
+ py3-pip \
19
+ make \
20
+ g++ \
21
+ build-base \
22
+ cairo-dev \
23
+ pango-dev \
24
+ chromium \
25
+ postgresql-client \
26
+ ffmpeg \
27
+ yt-dlp \
28
+ openssl \
29
+ busybox-extras \
30
+ curl \
31
+ bash \
32
+ unzip \
33
+ libaio
34
+
35
+ # Puppeteer/Chromium configuration
36
+ ENV PUPPETEER_SKIP_DOWNLOAD=true
37
+ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
38
+
39
+ # Install n8n globally (will install the latest stable version)
40
+ RUN npm install -g n8n
41
+
42
+ # Create necessary directories
43
+ RUN mkdir -p $DATABASE_PATH $CONFIG_PATH $WORKFLOWS_PATH $LOGS_PATH
44
+
45
+ # Set ownership to the 'node' user for security
46
+ RUN chown -R node:node $BASE_PATH
47
+
48
+ # Set owner and fix write permission for the working directory
49
+ RUN mkdir -p /data \
50
+ && chown -R node:node /data
51
+
52
+ # Set working directory
53
+ WORKDIR /data
54
+
55
+ # Switch to non-root user for execution (CRITICAL FOR SECURITY)
56
+ USER node
57
+
58
+ # Start n8n
59
+ CMD ["n8n", "start"]