forked from auto-mat/django-import-export-celery
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
155 lines (143 loc) · 3.38 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
version: "3.9"
# https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields
x-build: &dockerfile-dev-build
context: .
dockerfile: Dockerfile
services:
db:
image: postgres:12-alpine
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
networks:
- example
rabbitmq:
image: rabbitmq:3-management
ports:
- 15672:15672
volumes:
- ./tests/resources/custom-rabbitmq-conf:/etc/rabbitmq/
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 5s
retries: 5
networks:
- example
pubsub:
build: *dockerfile-dev-build
volumes:
- .:/app
env_file: .env
environment:
- AWS_S3_ENDPOINT_URL=http://minio:9000
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
createbuckets:
condition: service_completed_successfully
command: ["python", "example/manage.py", "import_export_pubsub"]
networks:
- example
example:
build: *dockerfile-dev-build
volumes:
- .:/app
env_file: .env
ports:
- "${DJANGO_BIND_PORT:-8080}:${DJANGO_BIND_PORT:-8080}"
depends_on:
pubsub:
condition: service_started
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
createbuckets:
condition: service_completed_successfully
command: ["./scripts/start-example.sh"]
networks:
- example
integration-tests:
build: *dockerfile-dev-build
volumes:
- .:/app
env_file: .env
ports:
- "${DJANGO_BIND_PORT:-8080}:${DJANGO_BIND_PORT:-8080}"
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
createbuckets:
condition: service_completed_successfully
command: ["./scripts/start-tests.sh"]
networks:
- example
sonar:
container_name: sonar
image: sonarqube:9-community
environment:
- SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true
ports:
- "9000:9000"
networks:
- example
sonar-cli:
container_name: sonar-cli
image: sonarsource/sonar-scanner-cli
working_dir: /api
environment:
- SONAR_LOGIN=admin
- SONAR_PASSWORD=test
volumes:
- .:/api
command: ["sonar-scanner", "--debug"]
networks:
- example
minio:
image: minio/minio:latest
ports:
- "9000:9000"
- "9001:9001"
command: minio server /s3-folder --console-address 0.0.0.0:9001
volumes:
- s3-folder:/s3-folder
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 20s
timeout: 10s
retries: 3
networks:
- example
createbuckets:
image: minio/mc
depends_on:
minio:
condition: service_healthy
volumes:
- s3-folder:/s3-folder
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add s3-folder http://minio:9000 root password;
/usr/bin/mc rm -r --force s3-folder/example;
/usr/bin/mc mb s3-folder/example;
/usr/bin/mc policy -r set download s3-folder/example;
exit 0;
"
networks:
- example
volumes:
s3-folder: null
networks:
example: