-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (77 loc) · 2.28 KB
/
Copy pathdocker-compose.yml
File metadata and controls
80 lines (77 loc) · 2.28 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
version: "3.9"
services:
n8n:
image: n8nio/n8n:latest
restart: always
ports:
- "5678:5678"
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD} # Use uma variável de ambiente para segurança
- N8N_HOST=localhost # Ou seu domínio, ex: n8n.example.com
- N8N_PORT=5678
- N8N_LOG_LEVEL=error # Níveis: fatal, error, warn, info, verbose, debug, silly
- N8N_PROTOCOL=http # ou https se usar proxy reverso com SSL
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
- GENERIC_TIMEZONE=America/Sao_Paulo # Timezone ajustado para Brasil
- TZ=America/Sao_Paulo # Timezone do container
volumes:
- ./n8n:/home/node/.n8n
depends_on:
- postgres
networks:
- n8n-net
extra_hosts:
- "host.docker.internal:host-gateway"
# Limites de recursos (usados por docker stack / swarm). OBS: `deploy` é
# ignorado pelo docker-compose tradicional. Ver notas abaixo para alternativas.
deploy:
resources:
limits:
cpus: "1"
memory: 1024M
reservations:
cpus: "0.25"
memory: 256M
# Limitação de logs para evitar consumo excessivo de disco
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
postgres:
image: postgres:15
restart: always
environment:
- POSTGRES_DB=n8n
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} # Use uma variável de ambiente para segurança
volumes:
- ./postgres:/var/lib/postgresql/data
networks:
- n8n-net
extra_hosts:
- "host.docker.internal:host-gateway"
deploy:
resources:
limits:
cpus: "1"
memory: 1024M
reservations:
cpus: "0.25"
memory: 256M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
n8n-net:
name: n8n-net
# Usando bind mounts locais em vez de volumes nomeados. O Compose criará
# as pastas ./n8n e ./postgres no diretório do projeto se não existirem.
# Ajuste permissões se necessário (ex: chown) dependendo do usuário dentro
# do container.