-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerComposeSnippet.astro
More file actions
96 lines (89 loc) · 2.14 KB
/
DockerComposeSnippet.astro
File metadata and controls
96 lines (89 loc) · 2.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
---
import Code from "astro/components/Code.astro";
import { browserlessImage, caddyImage, watchtowerImage, webImage } from "../../data/docker";
interface Props {
variant: "minimal" | "productionCaddy" | "secure" | "watchtower" | "resourceGuardrails";
}
const { variant } = Astro.props;
const snippets: Record<Props["variant"], string> = {
minimal: `services:
html2rss-web:
image: ${webImage}
restart: unless-stopped
ports:
- "127.0.0.1:4000:4000"
environment:
RACK_ENV: production
PORT: 4000
HTML2RSS_SECRET_KEY: your-generated-secret-key
HEALTH_CHECK_TOKEN: your-health-check-token
BROWSERLESS_IO_WEBSOCKET_URL: ws://browserless:4002
BROWSERLESS_IO_API_TOKEN: your-browserless-token
browserless:
image: "${browserlessImage}"
restart: unless-stopped
ports:
- "127.0.0.1:4002:4002"
environment:
PORT: 4002
CONCURRENT: 10
TOKEN: your-browserless-token`,
productionCaddy: `services:
caddy:
image: ${caddyImage}
ports:
- "80:80"
- "443:443"
volumes:
- caddy_data:/data
command:
- caddy
- reverse-proxy
- --from
- \${CADDY_HOST}
- --to
- html2rss:3000
html2rss:
image: ${webImage}
env_file: .env
volumes:
caddy_data:`,
secure: `services:
html2rss:
image: ${webImage}
environment:
RACK_ENV: production
LOG_LEVEL: warn
HEALTH_CHECK_USERNAME: your-secure-username
HEALTH_CHECK_PASSWORD: your-very-secure-password
BASE_URL: https://yourdomain.com`,
watchtower: `services:
watchtower:
image: ${watchtowerImage}
depends_on:
- html2rss
- caddy
command:
- --cleanup
- --interval
- "300"
- html2rss
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped`,
resourceGuardrails: `services:
html2rss:
image: ${webImage}
deploy:
resources:
limits:
memory: 512M
cpus: "0.5"
reservations:
memory: 256M
cpus: "0.25"`,
};
const code = snippets[variant];
---
<Code code={code} lang="yaml" />