-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (66 loc) · 1.96 KB
/
docker-compose.yml
File metadata and controls
69 lines (66 loc) · 1.96 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
services:
# Plain HTTP proxy
http-proxy:
image: hightemp/https_proxy:latest
container_name: https_proxy_http
restart: unless-stopped
ports:
- "8080:8080"
environment:
PROXY_ADDR: 0.0.0.0:8080
PROXY_PROTO: http
PROXY_USERNAME: ${PROXY_USERNAME:-}
PROXY_PASSWORD: ${PROXY_PASSWORD:-}
PROXY_UPSTREAM_PROXY: ${PROXY_UPSTREAM_PROXY:-}
# HTTPS proxy with Let's Encrypt certificates (read from shared volume)
https-proxy:
image: hightemp/https_proxy:latest
container_name: https_proxy_https
restart: unless-stopped
ports:
- "8443:8443"
environment:
PROXY_ADDR: 0.0.0.0:8443
PROXY_PROTO: https
PROXY_USERNAME: ${PROXY_USERNAME:-}
PROXY_PASSWORD: ${PROXY_PASSWORD:-}
PROXY_CERT_PATH: /etc/letsencrypt/live/${DOMAIN:?DOMAIN must be set in .env}/fullchain.pem
PROXY_KEY_PATH: /etc/letsencrypt/live/${DOMAIN}/privkey.pem
PROXY_UPSTREAM_PROXY: ${PROXY_UPSTREAM_PROXY:-}
volumes:
- letsencrypt:/etc/letsencrypt:ro
depends_on:
- certbot
# Let's Encrypt certificate manager.
# First-time issue:
# docker compose run --rm --service-ports certbot issue
# Then `docker compose up -d` runs auto-renewal in a loop.
certbot:
image: certbot/certbot:latest
container_name: https_proxy_certbot
restart: unless-stopped
environment:
DOMAIN: ${DOMAIN:?DOMAIN must be set in .env}
EMAIL: ${EMAIL:?EMAIL must be set in .env}
ports:
- "80:80"
volumes:
- letsencrypt:/etc/letsencrypt
- certbot-www:/var/www/certbot
entrypoint:
- /bin/sh
- -c
- |
if [ "$$1" = "issue" ]; then
exec certbot certonly --standalone \
-d "$$DOMAIN" -m "$$EMAIL" --agree-tos --no-eff-email --non-interactive
fi
trap exit TERM
while :; do
certbot renew --quiet
sleep 12h & wait $${!}
done
- --
volumes:
letsencrypt:
certbot-www: