mirror of
https://github.com/n8n-io/n8n.git
synced 2026-07-28 19:45:09 +02:00
34 lines
924 B
YAML
34 lines
924 B
YAML
volumes:
|
|
postgres-data:
|
|
# Only used when N8N_DATA_MOUNT is set to "n8n-data" (see .env.example)
|
|
n8n-data:
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_DB=n8n
|
|
- POSTGRES_PASSWORD=password
|
|
|
|
n8n:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
init: true
|
|
depends_on:
|
|
- postgres
|
|
volumes:
|
|
- ..:/workspaces
|
|
# .n8n storage. Defaults to a bind mount of the host's ~/.n8n (shares the
|
|
# encryption key/credentials with a local n8n install). Set N8N_DATA_MOUNT
|
|
# to "n8n-data" to use an isolated named volume instead — see .env.example.
|
|
- ${N8N_DATA_MOUNT:-${HOME}/.n8n}:/home/node/.n8n
|
|
command: sleep infinity
|
|
environment:
|
|
DB_POSTGRESDB_HOST: postgres
|
|
DB_TYPE: postgresdb
|
|
DB_POSTGRESDB_PASSWORD: password
|