Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
166 lines (157 loc) · 4.92 KB
/
Copy pathcompose.yml
File metadata and controls
166 lines (157 loc) · 4.92 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
x-logging: &logging
driver: json-file
options:
max-size: 20m
max-file: '5'
services:
db:
image: postgres:18.6-trixie
logging: *logging
restart: unless-stopped
environment:
POSTGRES_DB: carina
POSTGRES_USER: carina
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?}
volumes:
- ${CARINA_DB_DIR:?}:/var/lib/postgresql
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U carina -d carina']
interval: 5s
timeout: 3s
retries: 10
start_period: 1m
# app は uid 10001 で動くので、app が書く置き場の所有者をその番号にそろえてから app を上げる (中のファイルには触らない)
prepare:
image: ghcr.io/newworldorg/carina:v2.0.0
logging: *logging
restart: 'no'
entrypoint: ['chown', '10001:10001', '/var/lib/carina/keys', '/srv/encodes', '/srv/thumbnails', '/srv/captions']
volumes:
- ${CARINA_KEYS_DIR:?}:/var/lib/carina/keys
- ${CARINA_ENCODES_DIR:?}:/srv/encodes
- thumbnails:/srv/thumbnails
- captions:/srv/captions
migrate:
image: ghcr.io/newworldorg/carina:v2.0.0
logging: *logging
restart: 'no'
environment:
CARINA_ROLE: migrate
ConnectionStrings__Carina: Host=db;Port=5432;Database=carina;Username=carina;Password=${POSTGRES_PASSWORD:?}
depends_on:
db:
condition: service_healthy
app:
image: ghcr.io/newworldorg/carina:v2.0.0
logging: *logging
restart: unless-stopped
environment:
CARINA_ROLE: app
ConnectionStrings__Carina: Host=db;Port=5432;Database=carina;Username=carina;Password=${POSTGRES_PASSWORD:?}
CARINA_DATA_PROTECTION_KEYS: /var/lib/carina/keys
CARINA_PUBLIC_ORIGIN: ${CARINA_PUBLIC_ORIGIN:-}
# proxy はこの compose の網にいる。networks の subnet と同じ値にする
CARINA_KNOWN_NETWORKS: 172.30.0.0/24
Integrity__OutputRoots: primary=/srv/recordings
Thumbnails__WrittenTo: /srv/thumbnails
Captions__WrittenTo: /srv/captions
Encodings__OutputRoots: encodes=/srv/encodes
Encodings__Prefer: ${CARINA_ENCODINGS_PREFER:-Software}
Transcoding__Prefer: ${CARINA_TRANSCODING_PREFER:-Software}
Machine__RenderNode: ${CARINA_RENDER_NODE:-/dev/dri/renderD128}
volumes:
- driver-run:/run/carina
- ${CARINA_RECORDINGS_DIR:?}:/srv/recordings:ro
- ${CARINA_ENCODES_DIR:?}:/srv/encodes
- ${CARINA_KEYS_DIR:?}:/var/lib/carina/keys
- thumbnails:/srv/thumbnails
- captions:/srv/captions
healthcheck:
test:
- CMD
- bash
- -c
- "exec 3<>/dev/tcp/127.0.0.1/8080 && printf 'GET /api/health HTTP/1.0\\r\\nHost: app\\r\\n\\r\\n' >&3 && head -n 1 <&3 | grep -q ' 200 '"
interval: 30s
timeout: 5s
retries: 3
start_period: 2m
start_interval: 5s
depends_on:
db:
condition: service_healthy
prepare:
condition: service_completed_successfully
migrate:
condition: service_completed_successfully
driver:
condition: service_started
driver:
image: ghcr.io/newworldorg/puppis:v0.2.0
logging: *logging
# 要求による停止は 0、それ以外は 70 で終わるので on-failure は使わない
restart: unless-stopped
privileged: true
# 録画中に止められると録画の終わり (上限 shutdownGraceHours、既定 6 時間) まで待つ。それより長くする
stop_grace_period: 7h
environment:
PUPPIS_DRIVER_CONFIG: /etc/puppis/driver.json
volumes:
- ./driver/driver.json:/etc/puppis/driver.json:ro
- driver-run:/run/carina
- ${CARINA_RECORDINGS_DIR:?}:/srv/recordings
healthcheck:
test: ['CMD', '/opt/puppis/Puppis.Driver', '--probe']
interval: 30s
timeout: 15s
retries: 3
start_period: 5m
start_interval: 10s
vela:
image: ghcr.io/newworldorg/vela:v1.3.0
logging: *logging
restart: unless-stopped
environment:
CARINA_API_BASE_URL: http://app:8080
HOSTNAME: 0.0.0.0
healthcheck:
test:
- CMD
- node
- -e
- "fetch('http://127.0.0.1:3000/login').then((r) => process.exit(r.ok ? 0 : 1), () => process.exit(1))"
interval: 30s
timeout: 5s
retries: 3
start_period: 1m
start_interval: 5s
proxy:
image: caddy:2.11.7-alpine
logging: *logging
restart: unless-stopped
environment:
PYXIS_SITE_ADDRESS: ${PYXIS_SITE_ADDRESS:-:80}
ports:
- '${PYXIS_HTTP_PORT:-80}:80'
- '${PYXIS_HTTPS_PORT:-443}:443'
- '${PYXIS_HTTPS_PORT:-443}:443/udp'
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy-data:/data
- caddy-config:/config
depends_on:
app:
condition: service_started
vela:
condition: service_started
networks:
default:
ipam:
config:
- subnet: 172.30.0.0/24
volumes:
driver-run:
thumbnails:
captions:
caddy-data:
caddy-config: