-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
61 lines (56 loc) · 1.96 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
services:
static_hosting:
image: nginx
volumes:
- ./frontend/dist:/usr/share/nginx/html:ro
- ./settings/nginx.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- 80:80
backend:
image: couchdb:3
ports:
- 5984:5984
environment:
- COUCHDB_USER
- COUCHDB_PASSWORD
healthcheck:
test: curl -f http://localhost:5984/_up || exit 1
interval: 2s
timeout: 3s
accessible_backend:
image: curlimages/curl
entrypoint: ["/bin/sh","-c"]
command:
- |
alias put="curl -X PUT -u '${COUCHDB_USER}:${COUCHDB_PASSWORD}'"
put backend:5984/_node/nonode@nohost/_config/chttpd/enable_cors --data '"true"'
put backend:5984/_node/nonode@nohost/_config/cors/origins --data '"*"'
put backend:5984/qvotidie
put backend:5984/qvotidie/_security --data '{"members":{"roles":[]},"admins":{"roles":["_admin"]}}'
depends_on:
backend:
condition: service_healthy
updated_samples:
image: curlimages/curl
entrypoint: ["/bin/sh","-c"]
volumes:
- ./frontend/public/sample_data.json:/sample_data.json
command:
- |
curl -X POST http://backend:5984/qvotidie/_bulk_docs -H "Content-Type: application/json" -d @/sample_data.json
depends_on:
accessible_backend:
condition: service_completed_successfully
index:
image: curlimages/curl
entrypoint: ["/bin/sh","-c"]
volumes:
- ./backend/by_date.json:/by_date.json
- ./backend/by_section_and_date.json:/by_section_and_date.json
command:
- |
curl -X POST http://backend:5984/qvotidie/_index -H "Content-Type: application/json" -d @/by_date.json -u '${COUCHDB_USER}:${COUCHDB_PASSWORD}'
curl -X POST http://backend:5984/qvotidie/_index -H "Content-Type: application/json" -d @/by_section_and_date.json -u '${COUCHDB_USER}:${COUCHDB_PASSWORD}'
depends_on:
accessible_backend:
condition: service_completed_successfully