This repository has been archived by the owner on Jul 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
/
docker-compose.yml
97 lines (90 loc) · 2.25 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
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
97
version: "3"
services:
cli:
build: ./cli
image: evgeniy-khyst/letsencrypt-docker-compose-cli
user: ${CURRENT_USER}
group_add:
- ${DOCKER_GROUP}
environment:
- COMPOSE_PROJECT_NAME
- CURRENT_USER
- DOCKER_GROUP
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./:/workdir
profiles:
- config
nginx:
build: ./nginx
image: evgeniy-khyst/nginx
environment:
- DRY_RUN
volumes:
- ./config.json:/letsencrypt-docker-compose/config.json:ro
- ./nginx-conf/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx-conf/conf.d:/etc/nginx/conf.d:ro
- ./html:/var/www/html:ro
- nginx_conf_ssl:/etc/nginx/ssl
- letsencrypt_certs:/etc/letsencrypt
- certbot_acme_challenge:/var/www/certbot
ports:
- "80:80"
- "443:443"
healthcheck:
test: ["CMD", "nc", "-z", "nginx", "80"]
interval: 30s
timeout: 30s
start_period: 30s
retries: 10
restart: unless-stopped
certbot:
build: ./certbot
image: evgeniy-khyst/certbot
environment:
- DRY_RUN
volumes:
- ./config.json:/letsencrypt-docker-compose/config.json:ro
- letsencrypt_certs:/etc/letsencrypt
- certbot_acme_challenge:/var/www/certbot
healthcheck:
test:
[
"CMD-SHELL",
'test -n "$$(ls -A /etc/letsencrypt/live/)" || test "$$DRY_RUN" == "true" || exit 1',
]
interval: 30s
timeout: 30s
start_period: 30s
retries: 5
depends_on:
nginx:
condition: service_healthy
restart: unless-stopped
cron:
build: ./cron
image: evgeniy-khyst/cron
environment:
- COMPOSE_PROJECT_NAME
- DRY_RUN
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./:/workdir:ro
depends_on:
certbot:
condition: service_healthy
restart: unless-stopped
# Remove if you don't use PHP
php-fpm:
image: php:fpm-alpine
volumes:
- ./html:/var/www/html:ro
# Replace with your backend image or remove
example-backend:
build: ./examples/nodejs-backend
image: evgeniy-khyst/expressjs-helloworld
restart: unless-stopped
volumes:
nginx_conf_ssl:
letsencrypt_certs:
certbot_acme_challenge: