Skip to content

Commit 6491a26

Browse files
committed
improve deployment knowledge
1 parent 3fa0ac6 commit 6491a26

File tree

1 file changed

+118
-11
lines changed

1 file changed

+118
-11
lines changed

src/content/docs/web-application/how-to/deployment.mdx

Lines changed: 118 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,17 @@ When hosting a **public instance** that others will use, please follow these ess
3030

3131
### Security
3232

33-
- **Use a reverse proxy** ([nginx](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/), Apache, or Cloudflare) to handle SSL termination and rate limiting
34-
- **Enable HTTPS only** — redirect all HTTP traffic to HTTPS ([certbot guide](https://certbot.eff.org/))
33+
- **Use a reverse proxy** to handle SSL termination and rate limiting
34+
- **Enable HTTPS only** — redirect all HTTP traffic to HTTPS
3535
- **Set strong passwords** for health check and auto-source authentication
3636
- **Restrict access** to admin endpoints and sensitive configuration
3737

38+
### Modern Reverse Proxy Options
39+
40+
- **Caddy** — Automatic HTTPS, zero config
41+
- **Traefik** — Auto-discovery, perfect for Docker
42+
- **nginx** — Traditional, requires certbot setup
43+
3844
### HTTPS
3945

4046
Setting up HTTPS is crucial for any public instance. Follow these steps:
@@ -45,38 +51,132 @@ Setting up HTTPS is crucial for any public instance. Follow these steps:
4551
4. **Test your setup** using tools like [SSL Labs](https://www.ssllabs.com/ssltest/)
4652

4753
For detailed implementation guides, see:
54+
4855
- [Nginx SSL configuration](https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/)
4956
- [Apache SSL setup](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html)
5057
- [Cloudflare SSL/TLS settings](https://developers.cloudflare.com/ssl/)
5158

52-
### Reliability & Monitoring
59+
## Quick Docker Setup
60+
61+
### Caddy (Easiest)
62+
63+
```yaml
64+
services:
65+
caddy:
66+
image: caddy:2-alpine
67+
ports:
68+
- "80:80"
69+
- "443:443"
70+
volumes:
71+
- ./Caddyfile:/etc/caddy/Caddyfile
72+
- caddy_data:/data
73+
html2rss:
74+
image: html2rss/html2rss-web:latest
75+
environment:
76+
- BASE_URL=https://yourdomain.com
77+
78+
volumes:
79+
caddy_data:
80+
```
81+
82+
`Caddyfile`:
83+
84+
```caddy
85+
yourdomain.com {
86+
reverse_proxy html2rss:3000
87+
}
88+
```
89+
90+
### Traefik (Auto-discovery)
91+
92+
```yaml
93+
services:
94+
traefik:
95+
image: traefik:v3.0
96+
command:
97+
- --providers.docker=true
98+
- --providers.docker.exposedbydefault=false
99+
- --entrypoints.web.address=:80
100+
- --entrypoints.websecure.address=:443
101+
- --entrypoints.web.http.redirections.entrypoint.to=websecure
102+
- --entrypoints.web.http.redirections.entrypoint.scheme=https
103+
ports:
104+
- "80:80"
105+
- "443:443"
106+
volumes:
107+
- /var/run/docker.sock:/var/run/docker.sock:ro
108+
html2rss:
109+
image: html2rss/html2rss-web:latest
110+
environment:
111+
- BASE_URL=https://yourdomain.com
112+
labels:
113+
- traefik.enable=true
114+
- traefik.http.routers.html2rss.rule=Host(`yourdomain.com`)
115+
- traefik.http.routers.html2rss.entrypoints=websecure
116+
- traefik.http.routers.html2rss.tls.certresolver=letsencrypt
117+
- traefik.http.services.html2rss.loadbalancer.server.port=3000
118+
```
119+
120+
## Reliability & Monitoring
53121
54122
- **Enable auto-updates** using [watchtower](https://containrrr.dev/watchtower/) or similar tools
55123
- **Monitor the health check endpoint** (`/health_check.txt`) to detect issues early
56124
- **Set up logging** to track errors and performance
57125
- **Use environment variables** for configuration instead of hardcoded values
58126

59-
### Performance Optimization
127+
### Example: Adding Watchtower for Auto-updates
128+
129+
```yaml
130+
services:
131+
watchtower:
132+
image: containrrr/watchtower
133+
volumes:
134+
- /var/run/docker.sock:/var/run/docker.sock
135+
environment:
136+
- WATCHTOWER_CLEANUP=true
137+
- WATCHTOWER_POLL_INTERVAL=300
138+
```
139+
140+
## Performance Optimization
60141

61142
- **Configure appropriate resource limits** for your Docker containers
62143
- **Use a CDN** for static assets if serving many users
63144
- **Monitor memory usage** — html2rss-web can be memory-intensive with large feeds
64145
- **Set up caching** for frequently accessed feeds
65146

147+
### Example: Resource Limits
148+
149+
```yaml
150+
services:
151+
html2rss:
152+
image: html2rss/html2rss-web:latest
153+
deploy:
154+
resources:
155+
limits:
156+
memory: 512M
157+
cpus: "0.5"
158+
reservations:
159+
memory: 256M
160+
cpus: "0.25"
161+
```
162+
66163
## Environment Configuration
67164

68165
For production, update your environment variables:
69166

70167
```yaml
71-
environment:
72-
RACK_ENV: production
73-
LOG_LEVEL: warn
74-
HEALTH_CHECK_USERNAME: your-secure-username
75-
HEALTH_CHECK_PASSWORD: your-very-secure-password
76-
BASE_URL: https://your-domain.com
168+
services:
169+
html2rss:
170+
image: html2rss/html2rss-web:latest
171+
environment:
172+
RACK_ENV: production
173+
LOG_LEVEL: warn
174+
HEALTH_CHECK_USERNAME: your-secure-username
175+
HEALTH_CHECK_PASSWORD: your-very-secure-password
176+
BASE_URL: https://your-domain.com
77177
```
78178

79-
Use a [password manager](https://bitwarden.com/password-generator/) to generate strong values.
179+
> 💡 **Security Tip**: Use a [password manager](https://bitwarden.com/password-generator/) to generate strong, unique passwords for all authentication endpoints.
80180

81181
## Share Your Instance
82182

@@ -86,6 +186,13 @@ Once your instance is running smoothly:
86186
- **Test thoroughly** with various feed types before sharing
87187
- **Monitor usage** and be prepared to scale if needed
88188

189+
### Before Going Public
190+
191+
1. **Test your setup** with different feed configurations
192+
2. **Verify HTTPS** is working correctly
193+
3. **Check performance** under load
194+
4. **Review security settings** and access controls
195+
89196
## Need Help?
90197

91198
- **Deployment issues?** Check our [troubleshooting guide](/troubleshooting/troubleshooting)

0 commit comments

Comments
 (0)