forked from orf/django-docker-box
-
Notifications
You must be signed in to change notification settings - Fork 37
/
docker-compose.yml
184 lines (165 loc) · 4.16 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
version: "2.3"
x-base: &base
image: djangobox/django-docker-box:${PYTHON_VERSION}
build:
context: ${DJANGO_PATH}
dockerfile: ${PWD}/Dockerfile
args:
- PYTHON_VERSION=${PYTHON_VERSION}
cache_from:
- djangobox/django-docker-box:${PYTHON_VERSION}
volumes:
- ${DJANGO_PATH}:/tests/django/
- ./settings:/tests/django/tests/settings
- ./oracle_entrypoint.sh:/oracle_entrypoint.sh
# Using yaml merging here overwrites the arrays. Simpler to just mount this in every service.
- ./oracle:/oracle
entrypoint: bash -c "wait-for-it.sh -s -t 20 $${WAIT_FOR} -- python runtests.py $$@" --
x-postgres-base: &postgres-base
environment:
- POSTGRES_USER=django
- POSTGRES_PASSWORD=django
- POSTGRES_DB=django
# Set a few options to speed up postgresql tests.
command: -c fsync=off -c synchronous_commit=off -c full_page_writes=off
tmpfs:
- /var/lib/postgresql
services:
sqlite:
<<: *base
environment:
- DJANGO_SETTINGS_MODULE=settings.test_sqlite
entrypoint: python runtests.py
depends_on:
- memcached
- memcached2
sqlite-gis:
<<: *base
entrypoint: python runtests.py
environment:
- DJANGO_SETTINGS_MODULE=settings.test_sqlite_gis
postgres:
<<: *base
environment:
- DJANGO_SETTINGS_MODULE=settings.test_postgres
- WAIT_FOR=postgres-db:5432
depends_on:
- postgres-db
- memcached
- memcached2
postgres-db:
<<: *postgres-base
image: postgres:${POSTGRES_VERSION}-alpine
postgres-gis:
<<: *base
environment:
- DJANGO_SETTINGS_MODULE=settings.test_postgres_gis
- WAIT_FOR=postgres-gis-db:5432
depends_on:
- postgres-gis-db
postgres-gis-db:
<<: *postgres-base
image: postgis/postgis:${POSTGRES_VERSION}-${POSTGIS_VERSION}
mysql:
<<: *base
environment:
- DJANGO_SETTINGS_MODULE=settings.test_mysql
- WAIT_FOR=mysql-db:3306
depends_on:
- mysql-db
- memcached
- memcached2
mysql-db: &mysql_base
image: mysql:${MYSQL_VERSION}
entrypoint: ['/entrypoint.sh', '--default-authentication-plugin=mysql_native_password']
tmpfs:
- /var/lib/mysql
environment:
- MYSQL_USER=django
- MYSQL_PASSWORD=django
- MYSQL_DATABASE=django
- MYSQL_ALLOW_EMPTY_PASSWORD=1
mysql-gis:
<<: *base
environment:
- DJANGO_SETTINGS_MODULE=settings.test_mysql_gis
- WAIT_FOR=mysql-gis-db:3306
depends_on:
- mysql-gis-db
mysql-gis-db:
<<: *mysql_base
volumes:
- /var/lib/mysql
mariadb:
<<: *base
environment:
- DJANGO_SETTINGS_MODULE=settings.test_mariadb
- WAIT_FOR=mariadb-db:3306
depends_on:
- mariadb-db
- memcached
- memcached2
mariadb-db:
image: mariadb:${MARIADB_VERSION}
tmpfs:
- /var/lib/mysql
environment:
- MYSQL_USER=django
- MYSQL_PASSWORD=django
- MYSQL_DATABASE=django
- MYSQL_ALLOW_EMPTY_PASSWORD=1
oracle:
<<: *base
image: djangobox/django-docker-box:oracle-${PYTHON_VERSION}
environment:
- DJANGO_SETTINGS_MODULE=settings.test_oracle
- WAIT_FOR=oracle-db:1521
entrypoint: /oracle_entrypoint.sh python runtests.py
depends_on:
- oracle-db
- memcached
- memcached2
oracle-db:
image: sath89/oracle-12c
volumes:
- oracle:/u01/app/oracle/
environment:
- WEB_CONSOLE=false
memcached: &memcached
image: memcached:alpine
memcached2:
<<: *memcached
docs:
<<: *base
entrypoint: ["make", "spelling"]
working_dir: /tests/django/docs
user: root
flake8:
<<: *base
entrypoint: flake8
# Browser tests
chrome:
<<: *base
command: --selenium=chrome --selenium-hub=http://chrome-browser:4444/wd/hub
environment:
- WAIT_FOR=chrome-browser:4444
depends_on:
- chrome-browser
chrome-browser:
image: selenium/standalone-chrome
volumes:
- /dev/shm:/dev/shm
# Firefox tests fail on main
firefox:
<<: *base
command: --selenium=firefox --selenium-hub=http://firefox-browser:4444/wd/hub
environment:
- WAIT_FOR=firefox-browser:4444
depends_on:
- firefox-browser
firefox-browser:
image: selenium/standalone-firefox
volumes:
- /dev/shm:/dev/shm
volumes:
oracle: