Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
45 lines (41 loc) · 1.74 KB
/
Copy pathcompose.yml
File metadata and controls
45 lines (41 loc) · 1.74 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
# Example deployment behind an HTTPS reverse proxy on this machine: `docker compose up -d` (docs/deployment.md).
# Put the settings in .env next to this file (docs/configuration.md; a minimal one in docs/deployment.md).
# Docker keeps container logs forever by default: at most 3 files of 10 MB.
x-logging: &logging
driver: json-file
options:
max-size: 10m
max-file: "3"
services:
exceptic:
image: devforth/exceptic:latest # in production pin X.Y (docs/deployment.md)
restart: unless-stopped
# Time to finish requests, write the queue held in memory to disk and send queued notifications before Docker kills it (default 10 s).
stop_grace_period: 30s
# 512 MB is all it needs; it sizes its memory and queue by this limit (docs/deployment.md, Resources).
mem_limit: 512m
ports:
# Only on this machine, for its reverse proxy. A try over plain http from elsewhere: "8000:8000" with an http PUBLIC_URL.
- "127.0.0.1:8000:8000"
env_file: .env
logging: *logging
volumes:
- data:/data
# HTTPS for PUBLIC_URL's domain, with COMPOSE_PROFILES=caddy in .env; skip it when the machine has a proxy already.
caddy:
image: caddy:2
profiles: [caddy]
restart: unless-stopped
# On the host's ports 80 and 443, reaching Exceptic as a proxy installed on this machine would.
network_mode: host
cap_drop: [ALL]
cap_add: [NET_BIND_SERVICE]
security_opt: [no-new-privileges:true]
logging: *logging
# Caddy's own reverse proxy: HTTPS for PUBLIC_URL's domain, its certificate kept in caddy-data, no admin API.
command: caddy reverse-proxy --from ${PUBLIC_URL:-https://set-public-url-in-env.invalid} --to 127.0.0.1:8000
volumes:
- caddy-data:/data
volumes:
data:
caddy-data: