-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (98 loc) · 3.21 KB
/
Copy pathdocker-compose.yml
File metadata and controls
102 lines (98 loc) · 3.21 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# LinkedGrow, self hosted. This file is the whole install:
#
# docker compose up -d
#
# No .env, no secret to generate, no address to declare. The app writes its own
# secrets on the first start and answers on whatever address you open. Every
# other setting lives in the wizard at first login. The variables below are for
# people who want them, and each one already has the right default.
services:
db:
image: ghcr.io/tursodatabase/libsql-server:latest
restart: unless-stopped
environment:
SQLD_NODE: primary
SQLD_DB_PATH: /var/lib/sqld/iku.db
volumes:
- db-data:/var/lib/sqld
app:
image: ghcr.io/digihold/linkedgrow:${LINKEDGROW_VERSION:-latest}
restart: unless-stopped
# Published on every address of the machine, because a first install has no
# reverse proxy in front of it. APP_BIND=127.0.0.1 puts it back behind one.
ports:
- "${APP_BIND:-0.0.0.0}:${APP_PORT:-3000}:3000"
# Optional. Compose reads the file when it is there and says nothing when
# it is not, so an empty directory holding this file alone still starts.
env_file:
- path: .env
required: false
environment:
TURSO_DATABASE_URL: http://db:8080
TURSO_AUTH_TOKEN: ""
LINKEDGROW_EDITION: self-hosted
STORAGE_ROOT: /data/uploads
CONFIG_DIR: /data/config
volumes:
- uploads:/data/uploads
# AUTH_SECRET and ENCRYPTION_KEY, generated here on the first start and
# read by the worker. Back it up with the database: without it every
# stored LinkedIn password, 2FA secret and API key is unreadable.
- config:/data/config
depends_on:
- db
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
interval: 15s
timeout: 5s
retries: 20
start_period: 90s
worker:
image: ghcr.io/digihold/linkedgrow-worker:${LINKEDGROW_VERSION:-latest}
restart: unless-stopped
env_file:
- path: .env
required: false
environment:
TURSO_DATABASE_URL: http://db:8080
TURSO_AUTH_TOKEN: ""
LINKEDGROW_EDITION: self-hosted
WORKER_ENV: production
APP_INTERNAL_URL: http://app:3000
WORKER_SLOTS: ${WORKER_SLOTS:-2}
CONFIG_DIR: /data/config
shm_size: "2gb"
volumes:
- profiles:/data/profiles
- uploads:/data/uploads
# Read only: the app owns this file and always starts first, because this
# container waits for the app's health check before it runs.
- config:/data/config:ro
depends_on:
app:
condition: service_healthy
# Runs only with COMPOSE_PROFILES=https, and then it needs DOMAIN and the
# Caddyfile next to this file. The reverse proxy page of the documentation
# has the commands. Nothing about the plain install needs it.
caddy:
image: caddy:2
restart: unless-stopped
profiles: ["https"]
ports:
- "80:80"
- "443:443"
environment:
DOMAIN: ${DOMAIN:-}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy-data:/data
- caddy-config:/config
depends_on:
- app
volumes:
db-data:
uploads:
profiles:
config:
caddy-data:
caddy-config: