Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
164 lines (157 loc) · 5.2 KB
/
Copy pathcompose.yml
File metadata and controls
164 lines (157 loc) · 5.2 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
# Convoy production stack.
#
# Five containers. The first three are the same image running different
# commands, and all of them read their configuration from .env:
#
# web serves the panel (and terminates TLS)
# worker runs the queue -- every Proxmox action is a job, so nothing
# works without it
# scheduler runs the timed jobs in routes/console.php, including the
# per-minute polls behind the node status indicators
# postgres the database
# redis backs the queue, cache and sessions
#
# To use a database or Redis you already run, see "Using your own database and
# Redis" in docs/deployment.md.
name: convoy
services:
web:
image: ${CONVOY_IMAGE:-ghcr.io/convoypanel/panel}:${CONVOY_VERSION:-latest}
restart: unless-stopped
env_file:
- .env
environment:
# Only this container runs migrations and cache warming on boot. Setting
# this on the worker or scheduler too would have them race each other.
AUTORUN_ENABLED: "true"
# Serve HTTP and HTTPS, redirecting the former.
SSL_MODE: full
# "on" gets a real certificate automatically. It needs APP_DOMAIN to be a
# domain name that resolves here -- certificate authorities do not issue
# for bare IPs, so the installer sets this to "off" (self-signed) when you
# give it an IP address.
CADDY_AUTO_HTTPS: ${CONVOY_AUTO_HTTPS:-on}
CADDY_HTTP_SERVER_ADDRESS: "http://${APP_DOMAIN:?APP_DOMAIN is not set in .env}"
CADDY_HTTPS_SERVER_ADDRESS: "https://${APP_DOMAIN:?APP_DOMAIN is not set in .env}"
ports:
# The web server runs unprivileged and cannot bind 80/443 inside the
# container, so the standard ports map to its 8080/8443. The UDP line is
# HTTP/3. Automatic certificates need port 80 reachable from the internet.
- "${CONVOY_HTTP_PORT:-80}:8080"
- "${CONVOY_HTTPS_PORT:-443}:8443"
- "${CONVOY_HTTPS_PORT:-443}:8443/udp"
volumes:
- storage:/var/www/html/storage
# Issued certificates. Losing this means re-issuing on every restart,
# which is a quick way into a rate limit.
- caddy-data:/data/caddy
- caddy-config:/config/caddy
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
logging:
# A panel runs unattended for months, and Docker does not cap log files by
# default. This is how a control node fills its disk.
driver: json-file
options:
max-size: "10m"
max-file: "3"
worker:
image: ${CONVOY_IMAGE:-ghcr.io/convoypanel/panel}:${CONVOY_VERSION:-latest}
restart: unless-stopped
command: ["php", "artisan", "horizon"]
env_file:
- .env
# Horizon finishes the jobs it is holding when asked to stop. Cutting it off
# mid-job can leave a Proxmox operation half-applied.
stop_grace_period: 60s
volumes:
- storage:/var/www/html/storage
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
# The image's built-in check asks the web server, which is not running
# here. This exits non-zero when the queue is stopped or paused.
test: ["CMD", "php", "artisan", "horizon:status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
scheduler:
image: ${CONVOY_IMAGE:-ghcr.io/convoypanel/panel}:${CONVOY_VERSION:-latest}
restart: unless-stopped
command: ["php", "artisan", "schedule:work"]
env_file:
- .env
stop_grace_period: 30s
volumes:
- storage:/var/www/html/storage
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
# There is nothing to ask this container, and the image's built-in check
# would report it permanently unhealthy.
disable: true
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_DATABASE:-convoy}
POSTGRES_USER: ${DB_USERNAME:-convoy}
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD is not set in .env}
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-convoy} -d ${DB_DATABASE:-convoy}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
redis:
image: redis:8-alpine
restart: unless-stopped
# Persist to disk. The queue lives here, so an unsaved restart drops jobs
# that were accepted but not yet run.
command: ["redis-server", "--appendonly", "yes", "--save", "900", "1"]
volumes:
- redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
storage:
postgres:
redis:
caddy-data:
caddy-config: