-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
113 lines (97 loc) · 3.03 KB
/
docker-compose.yaml
File metadata and controls
113 lines (97 loc) · 3.03 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
version: '3.7'
x-common: &phabricator
depends_on:
- 'bootstrap'
environment:
PHABRICATOR_DOMAIN: 'phabricator.local'
PHABRICATOR_ENV: 'custom/docker'
PHABRICATOR_HTTP_PORT: '${HTTP_PORT:-80}'
PHABRICATOR_MYSQL_HOST: 'database'
PHABRICATOR_MYSQL_USER: 'root'
networks:
- 'backend'
volumes:
- '.:/usr/local/src/phlab'
# Supporting repositories.
- '../arcanist:/usr/local/src/arcanist'
- '../libphutil:/usr/local/src/libphutil'
- '../phabricator:/usr/local/src/phabricator'
# Configuration files.
- './support/docker/config.php:/usr/local/src/phabricator/conf/custom/docker.conf.php'
- '/usr/local/src/phabricator/conf/custom'
- '/usr/local/src/phabricator/conf/local'
# Data that should be persistent.
- 'diffusion:/var/repo'
# NOTE: This file is only needed by the `web` service, but there's currently
# no way to merge lists in YAML (see https://github.com/yaml/yaml/issues/48).
# Instead of duplicating the list of volumes across multiple services, just
# mount the PHP-FPM configuration in all services.
- './support/docker/php-fpm.conf:/usr/local/etc/php-fpm.conf'
services:
bootstrap:
<<: *phabricator
build: './support/docker/worker'
depends_on:
- 'database'
command:
- '/usr/local/src/phabricator/bin/storage'
- 'upgrade'
- '--force'
database:
image: 'mysql:5'
command:
- '--local_infile=0'
- '--log-error-verbosity=1'
- '--max-allowed-packet=32M'
- '--sql-mode=STRICT_ALL_TABLES'
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
networks:
- 'backend'
volumes:
- 'mysql:/var/lib/mysql'
nginx:
image: 'nginx:stable'
depends_on:
- 'web'
networks:
- 'frontend'
ports:
- '${HTTP_PORT:-80}:80'
volumes:
- './support/docker/nginx.conf:/etc/nginx/nginx.conf'
web:
<<: *phabricator
build: './support/docker/web'
networks:
- 'backend'
- 'frontend'
worker:
<<: *phabricator
build: './support/docker/worker'
# NOTE: This would be simpler if `bin/phd start` could launch daemons in
# the foreground (see https://secure.phabricator.com/D20643).
command:
- 'sh'
- '-c'
- |
# Send daemon logs to stderr (see https://worp.one/docker-symlink-your-log-files-to-stdout-and-stderr/).
ln --force --symbolic /proc/1/fd/2 /var/log/daemons.log
trap 'kill $${!}; /usr/local/src/phabricator/bin/phd reload' HUP
trap 'kill $${!}; /usr/local/src/phabricator/bin/phd stop; exit 143' TERM
/usr/local/src/phabricator/bin/phd start
# Keep the container running (see
# http://bigdatums.net/2017/11/07/how-to-keep-docker-containers-running/ and
# https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86).
while true; do
tail --follow /dev/null &
wait $${!}
done
stop_grace_period: '20s'
networks:
backend: {}
frontend: {}
volumes:
diffusion: {}
mysql: {}