-
Notifications
You must be signed in to change notification settings - Fork 384
/
docker-compose.yml
201 lines (183 loc) · 5.02 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
x-env: &x-env
APP_KEY: "${APP_KEY}"
BEATMAPS_DIFFICULTY_CACHE_SERVER_URL: http://beatmap-difficulty-lookup-cache
BROADCAST_DRIVER: redis
DB_CONNECTION_STRING: Server=db;Database=osu;Uid=osuweb;
DB_HOST: db
ES_HOST: http://elasticsearch:9200
ES_SOLO_SCORES_HOST: http://elasticsearch:9200
GITHUB_TOKEN: "${GITHUB_TOKEN}"
NOTIFICATION_REDIS_HOST: redis
PASSPORT_PUBLIC_KEY: "${PASSPORT_PUBLIC_KEY:-}"
REDIS_HOST: redis
x-web: &x-web
build:
context: ./docker/development
dockerfile: ../../Dockerfile.development
init: true
volumes:
- .:/app
environment:
<<: *x-env
services:
php:
<<: *x-web
command: ['octane', '--watch']
deploy:
restart_policy:
condition: on-failure
shm_size: '2gb' # for chromium
php-dusk:
<<: *x-web
command: ['octane', '--watch']
environment:
<<: *x-env
APP_ENV: dusk.local
OCTANE_STATE_FILE: /tmp/octane-state.json
assets:
<<: *x-web
command: ['watch']
job:
<<: *x-web
command: ['job']
testjs:
<<: *x-web
volumes:
- .:/app
- .docker/js-build/assets:/app/public/assets
- .docker/js-build/builds:/app/resources/builds
profiles: ['testjs']
command: ['test', 'js']
schedule:
<<: *x-web
command: ['schedule']
migrator:
<<: *x-web
command: ['migrate']
depends_on:
db:
condition: service_healthy
beatmap-difficulty-lookup-cache:
image: pppy/osu-beatmap-difficulty-lookup-cache
ports:
- "${BEATMAPS_DIFFICULTY_CACHE_EXTERNAL_PORT:-127.0.0.1:5001}:80"
notification-server:
image: pppy/osu-notification-server
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
volumes:
- .env:/app/.env
- ./storage/oauth-public.key:/app/oauth-public.key
environment:
<<: *x-env
ports:
# used by GitHub Actions test
- "${NOTIFICATION_EXTERNAL_PORT:-127.0.0.1:2345}:2345"
notification-server-dusk:
image: pppy/osu-notification-server
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
volumes:
- .env.dusk.local:/app/.env
- ./storage/oauth-public.key:/app/oauth-public.key
environment:
<<: *x-env
db:
image: mysql:8.0
volumes:
- database:/var/lib/mysql
- ./docker/development/db_user.sql:/docker-entrypoint-initdb.d/db_user.sql
environment:
<<: *x-env
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- "${MYSQL_EXTERNAL_PORT:-127.0.0.1:3306}:3306"
command: --default-authentication-plugin=mysql_native_password
healthcheck:
# important to use 127.0.0.1 instead of localhost as mysql starts twice.
# the first time it listens on sockets but isn't actually ready
# see https://github.com/docker-library/mysql/issues/663
start_interval: 1s
start_period: 60s
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"]
timeout: 60s
redis:
command: ['redis-server', '--save', '60', '1', '--loglevel', 'warning']
image: redis:latest
ports:
- "${REDIS_EXTERNAL_PORT:-127.0.0.1:6379}:6379"
healthcheck:
start_interval: 1s
start_period: 60s
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
timeout: 60s
volumes:
- redis:/data
elasticsearch:
# Version must be kept up to date with library defined in: composer.json
image: elasticsearch:7.17.16
ports:
- "${ES_EXTERNAL_PORT:-127.0.0.1:9200}:9200"
volumes:
- elasticsearch:/usr/share/elasticsearch/data
environment:
action.auto_create_index: false
discovery.type: single-node
ES_JAVA_OPTS: "-Xms512m -Xmx512m" # less OOM on default settings.
ingest.geoip.downloader.enabled: false
healthcheck:
start_interval: 1s
start_period: 60s
test: curl -s http://localhost:9200/_cluster/health?wait_for_status=yellow >/dev/null || exit 1
timeout: 60s
nginx:
image: nginx:latest
depends_on:
- php
- php-dusk
- notification-server
- notification-server-dusk
volumes:
- ./docker/development/nginx-default.conf:/etc/nginx/conf.d/default.conf
- .:/app
ports:
- "${NGINX_PORT:-8080}:80"
score-indexer:
image: pppy/osu-elastic-indexer:master
command: ["queue", "watch"]
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
elasticsearch:
condition: service_healthy
environment:
<<: *x-env
SCHEMA: "${SCHEMA:-1}"
score-indexer-test:
image: pppy/osu-elastic-indexer:master
command: ["queue", "watch"]
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
elasticsearch:
condition: service_healthy
environment:
<<: *x-env
# match with .env.testing.example
DB_CONNECTION_STRING: Server=db;Database=osu_test;Uid=osuweb;
ES_INDEX_PREFIX: test_
SCHEMA: test
volumes:
database:
elasticsearch:
redis: