-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
53 lines (49 loc) · 1.27 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
services:
csvbase_postgres:
image: postgres:13
ports:
- "7432:5432"
environment:
POSTGRES_PASSWORD: password
POSTGRES_DB: csvbase
networks:
csvbase:
volumes:
- ./init-schemas.sql:/docker-entrypoint-initdb.d/init-schemas.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
csvbase_migrations:
build:
context: .
environment:
CSVBASE_TOML: |
db_url = "postgresql://postgres:password@csvbase_postgres:5432/csvbase"
networks:
csvbase:
command:
/bin/bash -c "echo \"$$CSVBASE_TOML\" > ~/.csvbase.toml && alembic upgrade head"
depends_on:
csvbase_postgres:
condition: service_healthy
csvbase:
build: .
environment:
CSVBASE_TOML: |
db_url = "postgresql://postgres:password@csvbase_postgres:5432/csvbase"
command:
/bin/bash -c "echo \"$$CSVBASE_TOML\" > ~/.csvbase.toml && gunicorn 'csvbase.web.app:init_app()' -b :6001"
ports:
- "6001:6001"
networks:
csvbase:
depends_on:
csvbase_postgres:
condition: service_healthy
csvbase_migrations:
condition: service_completed_successfully
networks:
csvbase:
driver: bridge