Repository navigation
Expand file tree
/
Copy pathdocker-stack.yml
More file actions
129 lines (124 loc) · 3.14 KB
/
Copy pathdocker-stack.yml
File metadata and controls
129 lines (124 loc) · 3.14 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
services:
caddy:
image: ${BT_CADDY_IMAGE:-code.bettercorp.dev/bettercorp/bettertunnels/caddy:latest}
environment:
CLOUDFLARE_API_TOKEN: ${CLOUDFLARE_API_TOKEN}
APP_UPSTREAM: ${APP_UPSTREAM:-app}
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
- target: 443
published: 443
protocol: udp
mode: host
volumes:
- type: bind
source: /opt/better-tunnels/app/Caddyfile
target: /etc/caddy/Caddyfile
read_only: true
- caddy-data:/data
- caddy-config:/config
networks:
- public
deploy:
replicas: 1
restart_policy:
condition: any
update_config:
order: stop-first
failure_action: rollback
app:
image: ${BSB_IMAGE:-code.bettercorp.dev/bettercorp/service-base:node-latest}
environment:
BSB_CONFIG_PLUGIN: ${BSB_CONFIG_PLUGIN:-config-vault}
BSB_CONFIG_PLUGIN_PACKAGE: ${BSB_CONFIG_PLUGIN_PACKAGE:-@bsb/config-vault}
BSB_PLUGIN_DIRS: /mnt/plugins
BSB_SHOW_PACKAGES: ${BSB_SHOW_PACKAGES:-false}
vaultUrl: ${vaultUrl}
apiKeyId: ${apiKeyId}
apiSecret: ${apiSecret}
volumes:
- bsb-plugins:/mnt/plugins
- app-data:/data
networks:
- public
- data
deploy:
replicas: 1
restart_policy:
condition: any
update_config:
parallelism: 1
delay: 5s
order: start-first
failure_action: rollback
plugin-watcher:
image: ${BSB_IMAGE:-code.bettercorp.dev/bettercorp/service-base:node-latest}
environment:
BSB_PLUGIN_DIRS: /mnt/plugins
BSB_PLUGINS: ${BT_PACKAGE_SPEC:-@betterportal/tunnels@1.0}
BSB_PLUGIN_UPDATE: "true"
BSB_PLUGIN_WATCHER: "true"
BSB_SHOW_PACKAGES: ${BSB_SHOW_PACKAGES:-false}
volumes:
- bsb-plugins:/mnt/plugins
networks:
- public
deploy:
replicas: 1
restart_policy:
condition: any
update_config:
parallelism: 1
delay: 5s
order: start-first
failure_action: rollback
postgres:
image: postgres:18
environment:
POSTGRES_USER: ${POSTGRES_USER:-bettertunnels}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-bettertunnels}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 20
volumes:
- bettertunnels-postgres:/var/lib/postgresql
networks:
- data
deploy:
replicas: 1
restart_policy:
condition: any
placement:
constraints:
- node.role == manager
networks:
public:
driver: overlay
attachable: true
data:
driver: overlay
attachable: true
volumes:
bettertunnels-postgres:
name: app_bettertunnels-postgres
external: true
caddy-data:
name: app_caddy-data
external: true
caddy-config:
name: app_caddy-config
external: true
app-data:
name: app_bettertunnels-app-data
bsb-plugins:
name: app_bettertunnels-bsb-plugins