This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
docker-compose.testing.yml
90 lines (82 loc) · 2.02 KB
/
docker-compose.testing.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
version: "3.7"
x-test-base:
&test-base
restart: "no"
networks:
- lbb_testing_network
# settings
x-db-env:
&dbenv
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: lbb_test
MYSQL_USER: lbb_test
MYSQL_PASSWORD: labonneboite
x-common-env:
# database
&cenv
DB_NAME: lbb_test
DB_USER: lbb_test
DB_PASSWORD: labonneboite
DB_HOST: testing_mysql
DB_PORT: 3306
# elastic search
ES_HOST: testing_elasticsearch:9200
# other
OFFICE_TABLE: etablissements
LBB_ENV: test
services:
app:
<<: *test-base
hostname: labonneboite-backend
build:
context: .
dockerfile: docker/v3.10/Dockerfile
environment:
<<: *cenv
MAXFAIL: ${MAXFAIL:-1000}
TEST_FILES: ${TEST_FILES:-}
volumes:
- ./labonneboite/alembic/sql/testing:/sql
- ./labonneboite:/app/labonneboite
- ./testResults:/app/testResults
entrypoint: /bin/bash /entrypoints/test.sh
depends_on:
testing_elasticsearch:
condition: service_healthy
testing_mysql:
condition: service_healthy
# ###### 3rd-party services
# # https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
# # https://www.elastic.co/blog/how-to-make-a-dockerfile-for-elasticsearch
testing_elasticsearch:
<<: *test-base
hostname: elasticsearch
image: elasticsearch:1.7.2
environment:
- "ES_JAVA_OPTS=-Xms4g -Xmx4g"
- "cluster.name=lbb"
- "bootstrap.memory_lock=true"
ulimits:
memlock:
soft: -1
hard: -1
healthcheck:
test: curl --fail localhost:9200/_cat/health || exit 1
interval: 10s
retries: 5
timeout: 2s
# database
testing_mysql:
<<: *test-base
image: mysql:5.6.36
environment:
<<: *dbenv
volumes:
- ./labonneboite/alembic/sql/testing.initdb.d:/docker-entrypoint-initdb.d
healthcheck:
test: "/usr/bin/mysql --user=root --password=password --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
networks:
lbb_testing_network: {}