-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
44 lines (42 loc) · 1.39 KB
/
docker-compose.yml
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
# Certbot setup inspired by
# https://github.com/wmnnd/nginx-certbot/blob/master/docker-compose.yml
# and
# https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
# See also
# https://certbot.eff.org/docs/install.html#running-with-docker
services:
reverse_proxy: # https://hub.docker.com/_/nginx
restart: always
image: nginx:1.25-bookworm
command: [
"nginx",
"-g", "daemon off;"
]
healthcheck:
test: ["CMD-SHELL", "service nginx status || exit 1"]
interval: 30s
timeout: 30s
retries: 3
ports:
- ${HTTP_PORT}:80
- ${HTTPS_PORT}:443
volumes:
- ./nginx/.htpasswd:/etc/apache2/.htpasswd:ro
- ./nginx/templates:/etc/nginx/templates:ro
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./certbot/conf:/etc/letsencrypt:ro
- ./certbot/www:/var/www/certbot:ro
environment:
- PRODUCTION_HTTP_PORT=${PRODUCTION_HTTP_PORT}
- PRODUCTION_HOST=${PRODUCTION_HOST}
- NON_WWW_PRODUCTION_HOST=${NON_WWW_PRODUCTION_HOST}
- STAGING_HTTP_PORT=${STAGING_HTTP_PORT}
- STAGING_HOST=${STAGING_HOST}
extra_hosts:
- host.docker.internal:host-gateway
certbot: # https://hub.docker.com/r/certbot/certbot
restart: always
image: certbot/certbot:v2.8.0
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot