-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
100 lines (83 loc) · 2.23 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
version: "3.7"
services:
# POSTGRESQL
database:
env_file:
- .env
build:
context: ./database
dockerfile: Dockerfile
restart: on-failure
ports:
- "45432:5432"
environment:
POSTGRES_DB: istsos
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
DATADIR: /var/lib/postgresql/data
POSTGRES_MULTIPLE_EXTENSIONS: postgis,hstore,postgis_topology,postgis_raster,pgrouting,ltree,pg_cron,uuid-ossp
command: postgres -c custom.hostname="${HOSTNAME}"
volumes:
# - v-istsos-miu-postgis-sql:/docker-entrypoint-initdb.d
- v-istsos-miu-database-data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U admin -d istsos
interval: 10s
timeout: 5s
retries: 5
postgrest:
image: postgrest/postgrest
ports:
- "3000:3000"
links:
- database:db
environment:
PGRST_DB_URI: postgres://admin:admin@database:5432/istsos
PGRST_DB_SCHEMA: sensorthings
PGRST_DB_ANON_ROLE: admin #In production this role should not be the same as the one used for the connection
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
PGRST_LOG_LEVEL: info
depends_on:
- database
api:
build:
context: ./fastapi
dockerfile: Dockerfile
volumes:
- ./fastapi/app:/code/app
working_dir: /code
ports:
- 8018:5000
command: uvicorn --reload --workers 1 --host 0.0.0.0 --port 5000 app.main:app
depends_on:
- postgrest
dummy_data:
env_file:
- .env
build:
context: ./dummy_data
dockerfile: Dockerfile
volumes:
- ./dummy_data:/code/app
working_dir: /dummy_data
command: python3 gen_data.py
depends_on:
database:
condition: service_healthy
# dummy_data:
# build:
# context: ./dummy_data
# dockerfile: Dockerfile
# volumes:
# - ./dummy_data:/code/app
# working_dir: /dummy_data
# command: python3 gen_data.py
# depends_on:
# - database
volumes:
v-istsos-miu-postgis-sql:
name: v-istsos-miu-postgis-sql
v-istsos-miu-database-data:
name: v-istsos-miu-database-data
v-istsos-miu-database-data-test:
name: v-istsos-miu-database-data-test