-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
44 lines (41 loc) · 1.39 KB
/
docker-compose.yaml
File metadata and controls
44 lines (41 loc) · 1.39 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
#https://docs.docker.com/registry/deploying/#deploy-your-registry-using-a-compose-file
services:
nginx:
image: 'nginx:stable-alpine'
ports:
- 80:80
- 443:443
restart: unless-stopped
volumes:
- ./config/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
depends_on:
- registry
- docker_auth
command: /bin/sh -c "while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g 'daemon off;'"
# SSL certificate management for nginx
certbot:
image: certbot/certbot
container_name: 'certbot'
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
restart: always
# This will check if your certificate is up for renewal every 12 hours as recommended by Let’s Encrypt
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
registry:
restart: always
image: registry:2
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./config/registry/config.yml:/etc/docker/registry/config.yml
- /mnt/docker0storage/registry:/var/lib/registry
docker_auth:
image: cesanta/docker_auth
volumes:
- ./config/docker_auth:/config:ro
- /var/log/docker_auth:/logs
- ./certbot/conf:/etc/letsencrypt
command: /config/auth_config.yml
restart: always