-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.dist.yml
156 lines (148 loc) · 3.31 KB
/
docker-compose.dist.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
version: '3.4'
services:
web:
image: elyby/accounts/nginx:local
build:
context: .
target: web
args:
build_env: dev
depends_on:
- app
- emails-renderer
env_file: .env
ports:
- 80:80
volumes:
- ./:/var/www/html
app:
image: elyby/accounts:local
build:
context: .
target: app
args:
build_env: dev
depends_on:
- db
- redis
volumes:
- ./:/var/www/html
env_file: .env
networks:
default:
aliases:
- php
worker:
image: elyby/accounts:local
build:
context: .
target: app
args:
build_env: dev
command: ['php', 'yii', 'queue/listen', '-v']
depends_on:
- db
- redis
volumes:
- ./:/var/www/html
env_file: .env
cron:
image: elyby/accounts:local
build:
context: .
target: app
args:
build_env: dev
command: ['crond', '-s', '/etc/cron.d', '-f', '-L', '/var/log/cron.log']
stop_signal: SIGKILL
depends_on:
- db
- redis
volumes:
- ./:/var/www/html
env_file: .env
emails-renderer:
image: ghcr.io/elyby/emails-renderer:latest
db:
image: elyby/accounts/mariadb:local
build:
context: .
target: db
args:
build_env: dev
volumes:
- ./data/mariadb:/bitnami/mariadb
environment:
ALLOW_EMPTY_PASSWORD: "yes"
MARIADB_ROOT_PASSWORD: ""
MARIADB_DATABASE: ely_accounts
MARIADB_USER: ely_accounts_user
MARIADB_PASSWORD: ely_accounts_password
redis:
image: redis:5.0-alpine
volumes:
- ./data/redis:/data
# If you want to use separate databases for the tests follow the next steps:
# 1) Create a file common/config/config-local.php with the next containment:
#
# <?php
# if (YII_ENV !== 'test') {
# return [];
# }
#
# return [
# 'components' => [
# 'db' => [
# 'dsn' => 'mysql:host=testdb;dbname=test',
# 'username' => 'test',
# 'password' => 'test',
# ],
# 'unbufferedDb' => [
# 'dsn' => 'mysql:host=testdb;dbname=test',
# 'username' => 'test',
# 'password' => 'test',
# ],
# 'redis' => [
# 'hostname' => 'testredis',
# 'password' => null,
# 'port' => 6379,
# 'database' => 0,
# ],
# ],
# ];
#
# 2) Uncomment the next 2 services (testdb and testredis):
#
# testdb:
# image: elyby/accounts/mariadb:local
# build:
# context: .
# target: db
# args:
# build_env: dev
# volumes:
# - ./data/mariadb-test:/bitnami/mariadb
# environment:
# ALLOW_EMPTY_PASSWORD: "yes"
# MARIADB_ROOT_PASSWORD: ""
# MARIADB_DATABASE: test
# MARIADB_USER: test
# MARIADB_PASSWORD: test
#
# testredis:
# image: redis:5.0-alpine
# volumes:
# - ./data/redis-test:/data
#
# 4) To run migrations on tests' database you must execute slightly adjusted
# migrate command: "env YII_ENV=test yii migrate"
phpmyadmin:
build: ./docker/phpmyadmin
environment:
- PMA_ARBITRARY=1
- PMA_USER=root
- PMA_PASSWORD=
depends_on:
- db
ports:
- 8080:80