danghungithp commited on
Commit
18b56f8
·
verified ·
1 Parent(s): 9095514

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base image with Node.js
2
+ FROM node:18-alpine
3
+ USER root
4
+
5
+ # Arguments that can be passed at build time
6
+ ARG N8N_PATH=/usr/local/lib/node_modules/n8n
7
+ ARG BASE_PATH=/root/.n8n
8
+ ARG DATABASE_PATH=$BASE_PATH
9
+ ARG LOG_PATH=$BASE_PATH/logs
10
+ ARG STORAGE_PATH=$BASE_PATH/storage
11
+
12
+ # Install dependencies
13
+ RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev
14
+
15
+ # Install n8n globally
16
+ RUN npm install -g n8n
17
+
18
+ # Create directories and set permissions
19
+ RUN mkdir -p $LOG_PATH $N8N_PATH/uploads && chmod -R 777 $LOG_PATH $N8N_PATH
20
+
21
+ # Set work directory
22
+ WORKDIR /data
23
+
24
+ # Configure environment variables (can be set in your docker-compose or runtime)
25
+ ENV DB_TYPE=postgresdb
26
+ ENV DB_POSTGRESDB_HOST=postgres
27
+ ENV DB_POSTGRESDB_USER=${POSTGRES_USER}
28
+ ENV DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
29
+ ENV N8N_DIAGNOSTICS_ENABLED=false
30
+ ENV N8N_PERSONALIZATION_ENABLED=false
31
+ ENV N8N_HOST=n8n.web4ai.cloud
32
+ ENV N8N_PROTOCOL=https
33
+ ENV N8N_SECURE_COOKIE=true
34
+ ENV N8N_PORT=5678
35
+ ENV N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
36
+ ENV N8N_USER_MANAGEMENT_JWT_SECRET=${N8N_USER_MANAGEMENT_JWT_SECRET}
37
+
38
+ # Expose the default n8n port
39
+ EXPOSE 5678
40
+
41
+ # Start n8n
42
+ CMD ["n8n"]