-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproduction.yaml
72 lines (72 loc) · 2.5 KB
/
production.yaml
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
name: "production_scouting_server"
version: 1.0.0
services:
server:
env_file: .serverenvfile
restart: on-failure
build:
dockerfile: Dockerfile
context: .
target: production
depends_on:
couchdb:
condition: service_healthy
couch-db-setup:
condition: service_completed_successfully
ports:
- "3000:3000"
links:
- couchdb:couchdb
environment:
- couchDBHostname=couchdb
- COUCHDB_SERVER_USER=${SERVER_USERNAME}
- COUCHDB_SERVER_PASSWORD=${SERVER_PASSWORD}
networks:
- intercom_network
couchdb:
env_file: .serverenvfile
restart: on-failure
expose:
- '5984'
environment:
- COUCHDB_USER=${SERVER_USERNAME}
- COUCHDB_PASSWORD=${SERVER_PASSWORD}
ports:
- '5984:5984'
image: 'couchdb:3'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5984"]
interval: 10s
timeout: 3s
retries: 5
networks:
- intercom_network
volumes:
- couchDB:/opt/couchdb/data
couch-db-setup:
env_file: .serverenvfile
restart: on-failure
depends_on:
couchdb:
condition: service_healthy
build:
target: setup
dockerfile_inline: |
FROM curlimages/curl:8.6.0 AS setup
CMD curl -s -X PUT http://${SERVER_USERNAME}:${SERVER_PASSWORD}@couchdb:5984/_users; \
curl -s -X PUT http://${SERVER_USERNAME}:${SERVER_PASSWORD}@couchdb:5984/_replicator; \
curl -s -X PUT http://${SERVER_USERNAME}:${SERVER_PASSWORD}@couchdb:5984/_global_changes; \
curl -s -X PUT http://${SERVER_USERNAME}:${SERVER_PASSWORD}@couchdb:5984/_node/nonode@nohost/_config/chttpd/enable_cors -d '"true"'; \
curl -s -X PUT http://${SERVER_USERNAME}:${SERVER_PASSWORD}@couchdb:5984/_node/nonode@nohost/_config/cors/origins -d '"*"'; \
curl -s -X PUT http://${SERVER_USERNAME}:${SERVER_PASSWORD}@couchdb:5984/_node/nonode@nohost/_config/cors/credentials -d '"true"'; \
curl -s -X PUT http://${SERVER_USERNAME}:${SERVER_PASSWORD}@couchdb:5984/_node/nonode@nohost/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'; \
curl -s -X PUT http://${SERVER_USERNAME}:${SERVER_PASSWORD}@couchdb:5984/_node/nonode@nohost/_config/cors/headers -d '"accept, authorization, content-type, origin, referer, x-csrf-token"'
network_mode: service:couchdb
networks:
intercom_network:
name: intercom
external: false
volumes:
couchDB:
driver: local
name: CouchDB_Volume