forked from fedspendingtransparency/usaspending-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
73 lines (67 loc) · 2.59 KB
/
docker-compose.yaml
File metadata and controls
73 lines (67 loc) · 2.59 KB
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
version: '3.7'
# See run instructions in accompanying Dockerfile
services:
usaspending-db:
container_name: usaspending-db
image: postgres:10.6-alpine
volumes:
- type: bind
source: ${POSTGRES_CLUSTER_DIR}
target: /var/lib/postgresql/data
restart: on-failure:3 # Will attempt to start the db 3 times
ports:
- ${POSTGRES_PORT}:5432
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: data_store_api
usaspending-manage:
build: .
volumes:
- .:/dockermount
command: python3 -u manage.py shell
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
ES_HOSTNAME: ${ES_HOSTNAME}
DATA_BROKER_DATABASE_URL: postgresql://${BROKER_USER}:${BROKER_PASSWORD}@${BROKER_HOST}:${BROKER_PORT}/data_broker
usaspending-api:
build: .
volumes:
- .:/dockermount
ports:
- 8000:8000
command: python3 -u manage.py runserver 0.0.0.0:8000
environment:
RUN_LOCAL_DOWNLOAD_IN_PROCESS: "False"
DB_SOURCE: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
DB_R1: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
DOWNLOAD_DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
ES_HOSTNAME: ${ES_HOSTNAME}
usaspending-bulk-download:
build: .
restart: on-failure:5 # 5 max attempt, and then it will stop restarting. NOTE: bulk download errors will cause one failure+restart iterations
volumes:
- .:/dockermount
command: python3 manage.py download_sqs_worker
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
DOWNLOAD_DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/data_store_api
usaspending-es:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
environment:
- cluster.name=usaspending
- network.host=0.0.0.0
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1536m -Xmx1536m" # Ensure Docker is allocated plenty of memory, otherwise this will fail
- "discovery.zen.ping.unicast.hosts=usaspending-es"
- discovery.zen.minimum_master_nodes=1
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- type: bind
source: ${ES_CLUSTER_DIR}
target: /usr/share/elasticsearch/data
ports:
- 9200:9200