forked from OpenDominion/OpenDominion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (68 loc) · 2.27 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (68 loc) · 2.27 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
services:
app:
build:
context: .
dockerfile: docker/Dockerfile
image: opendominion-app
ports:
- '${APP_PORT:-80}:80'
volumes:
- '.:/var/www/html'
# vendor/ is kept in a named volume to avoid stale host-installed packages
# breaking the container (e.g. wrong PHP version). The container runs
# "composer install" automatically whenever vendor/ is missing or empty.
# To use a local vendor/ instead (e.g. for IDE autocomplete), remove this
# line and run "composer install" on the host — the container will use
# whatever is on disk and skip reinstalling if autoload.php is present.
- 'opendominion-vendor:/var/www/html/vendor'
# Same rationale as vendor/ — node_modules/ is isolated to prevent host
# yarn runs from polluting the container, and yarn --frozen-lockfile is
# used to ensure an exact install from yarn.lock. Remove this line to use
# a local node_modules/ instead (requires running "yarn install" on the host first).
- 'opendominion-node-modules:/var/www/html/node_modules'
environment:
DB_HOST: mariadb
DB_PORT: 3306
DB_DATABASE: '${DB_DATABASE:-opendominion}'
DB_USERNAME: '${DB_USERNAME:-opendominion}'
DB_PASSWORD: '${DB_PASSWORD:-secret}'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost']
start_period: 360s
interval: 15s
retries: 3
timeout: 5s
depends_on:
mariadb:
condition: service_healthy
networks:
- opendominion
mariadb:
image: 'mariadb:10.11'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD:-secret}'
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: '${DB_DATABASE:-opendominion}'
MYSQL_USER: '${DB_USERNAME:-opendominion}'
MYSQL_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
- 'opendominion-mariadb:/var/lib/mysql'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-uroot', '-p${DB_PASSWORD:-secret}']
retries: 5
interval: 5s
timeout: 5s
networks:
- opendominion
networks:
opendominion:
driver: bridge
volumes:
opendominion-mariadb:
driver: local
opendominion-vendor:
driver: local
opendominion-node-modules:
driver: local