-
Notifications
You must be signed in to change notification settings - Fork 468
/
docker-compose.yml
104 lines (100 loc) · 2.61 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
version: "3.5"
# shared network so other openstates packages (core, etc.) can reach these services
networks:
openstates-network:
name: openstates-network
# shared postgres volume so other openstates packages can read the data more consistently
volumes:
openstates-postgres:
name: openstates-postgres
services:
scrape:
build:
context: .
no_cache: true
pull: true
environment:
- AR_FTP_USER
- AR_FTP_PASSWORD
- MYSQL_HOST=mysql
- DATABASE_URL=postgres://openstates:openstates@db/openstatesorg
- PYTHONPATH=./scrapers
- NEW_YORK_API_KEY
- INDIANA_API_KEY
- DC_API_KEY
- VIRGINIA_FTP_USER
- VIRGINIA_FTP_PASSWORD
- S3_REALTIME_BASE=s3://openstates-realtime-bills
- STATS_ENABLED
- STATS_RETRIES=1
- STATS_ENDPOINT
- STATS_JWT_TOKEN
# - STATS_PREFIX
# - STATS_BATCH_SIZE
volumes:
- .:/opt/openstates/openstates/
entrypoint: ["poetry", "run", "os-update"]
networks:
- openstates-network
extra_hosts:
- "host.docker.internal:host-gateway"
mysql:
image: mariadb:10.5
# command: mysqld_safe --max_allowed_packet=512M
ports:
- "3306:3306"
environment:
- MYSQL_DATABASE=capublic
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_LOG_CONSOLE=yes
networks:
- openstates-network
ca-scrape:
build:
context: .
dockerfile: Dockerfile.california
environment:
- MYSQL_HOST=mysql
- DATABASE_URL=postgres://openstates:openstates@db/openstatesorg
- PYTHONPATH=./scrapers
- STATS_ENABLED
- STATS_RETRIES=1
- STATS_ENDPOINT
- STATS_JWT_TOKEN
volumes:
- .:/opt/openstates/openstates/
entrypoint: ["poetry", "run", "os-update"]
networks:
- openstates-network
ca-download:
build:
context: .
dockerfile: Dockerfile.california
entrypoint: /opt/openstates/openstates/scrapers/ca/download.sh
environment:
- MYSQL_HOST=mysql
volumes:
- .:/opt/openstates/openstates/
depends_on:
- mysql
networks:
- openstates-network
db:
image: "mdillon/postgis:11-alpine"
hostname: "db"
ports:
- "5405:5432"
environment:
POSTGRES_PASSWORD: openstates
POSTGRES_USER: openstates
POSTGRES_DB: openstatesorg
volumes:
- openstates-postgres:/var/lib/postgresql/data
networks:
- openstates-network
command: ["postgres", "-c", "log_statement=all"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -q -d openstatesorg -U openstates"]
interval: 10s
timeout: 5s
retries: 15