This repository has been archived by the owner on May 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
97 lines (93 loc) · 3.57 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
# This Docker compose file is modified from the example given in the
# official Ghost image by Docker on https://store.docker.com/images/ghost,
# integrating the work of the following devs:
# - Adrian Perez (mariadb and Docker volumes): https://adrianperez.org/advanced-deployment-of-ghost-in-2-minutes-with-docker/
# - Docker compose file reference (the Right Way™ to do volumes): https://docs.docker.com/compose/compose-file/#service-configuration-reference
version: '3.1'
services:
## Ghost blog container definition
ghost:
image: ghost:alpine
container_name: deionarra
restart: always
environment:
url: http://localhost
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: example
database__connection__database: ghost
## Settings for reverse proxy and Let's Encrypt
VIRTUAL_HOST: localhost
LETSENCRYPT_HOST: example.com
LETSENCRYPT_EMAIL: [email protected]
volumes:
- legacy:/var/lib/ghost/content
networks:
- proxy
- bridge
## Database container definition
db:
image: mysql:8.0
container_name: mimir
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
volumes:
- mimir:/var/lib/mysql
networks:
- bridge
## Reverse-proxy container definitions
nginx:
image: nginx:alpine
container_name: ${CONTAINER_NGINX:-nginx}
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ${NGINX_FILES_PATH:-./nginx-data}/conf.d:/etc/nginx/conf.d
- ${NGINX_FILES_PATH:-./nginx-data}/vhost.d:/etc/nginx/vhost.d
- ${NGINX_FILES_PATH:-./nginx-data}/html:/usr/share/nginx/html
- ${NGINX_FILES_PATH:-./nginx-data}/certs:/etc/nginx/certs:ro
- ${NGINX_FILES_PATH:-./nginx-data}/htpasswd:/etc/nginx/htpasswd:ro
networks:
- proxy
docker-gen:
image: jwilder/docker-gen
container_name: ${CONTAINER_DOCKERGEN:-docker-gen}
restart: always
command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
- ${NGINX_FILES_PATH:-./nginx-data}/conf.d:/etc/nginx/conf.d
- ${NGINX_FILES_PATH:-./nginx-data}/vhost.d:/etc/nginx/vhost.d
- ${NGINX_FILES_PATH:-./nginx-data}/html:/usr/share/nginx/html
- ${NGINX_FILES_PATH:-./nginx-data}/certs:/etc/nginx/certs:ro
- ${NGINX_FILES_PATH:-./nginx-data}/htpasswd:/etc/nginx/htpasswd:ro
networks:
- proxy
## Let's Encrypt
letsencrypt-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: ${CONTAINER_LETSENCRYPT:-letsencrypt-nginx-proxy-companion}
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${NGINX_FILES_PATH:-./nginx-data}/conf.d:/etc/nginx/conf.d
- ${NGINX_FILES_PATH:-./nginx-data}/vhost.d:/etc/nginx/vhost.d
- ${NGINX_FILES_PATH:-./nginx-data}/html:/usr/share/nginx/html
- ${NGINX_FILES_PATH:-./nginx-data}/certs:/etc/nginx/certs:rw
environment:
NGINX_DOCKER_GEN_CONTAINER: ${CONTAINER_DOCKERGEN:-docker-gen}
NGINX_PROXY_CONTAINER: ${CONTAINER_NGINX:-nginx}
ACME_CA_URI: ${ACME_CA_URI:-https://acme-staging-v02.api.letsencrypt.org/directory}
networks:
- proxy
volumes:
legacy: ## Ghost data volume declaration
mimir: ## Database data volume declaration
networks:
bridge: ## Private bridge network declaration
proxy: ## Public proxy network declaration