-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
71 lines (67 loc) · 1.69 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
version: '3.8'
services:
timescaledb:
image: timescale/timescaledb:latest-pg15
container_name: mev_timescaledb
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- "${DB_PORT}:5432"
volumes:
- timescale_data:/var/lib/postgresql/data
- ./init-postgrest.sql:/docker-entrypoint-initdb.d/init-postgrest.sql
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER}" ]
interval: 10s
timeout: 5s
retries: 5
env_file:
- .env
restart: unless-stopped
postgrest:
image: postgrest/postgrest:latest
container_name: postgrest
depends_on:
timescaledb:
condition: service_healthy
environment:
- PGRST_DB_URI=${PGRST_DB_URI}
- PGRST_DB_SCHEMA=${PGRST_DB_SCHEMA}
- PGRST_DB_ANON_ROLE=${PGRST_DB_ANON_ROLE}
- PGRST_SERVER_PORT=${PGRST_SERVER_PORT}
- PGRST_DB_MAX_ROWS=1000
ports:
- "3003:3000"
healthcheck:
test: [ "CMD-SHELL", "curl --fail http://localhost:3000 || exit 1" ]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
app:
build:
context: .
dockerfile: Dockerfile
container_name: app
depends_on:
timescaledb:
condition: service_healthy
environment:
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_HOST=mev_timescaledb
- DB_PORT=${DB_PORT}
- PYTHONUNBUFFERED=1
tty: true
logging:
driver: "json-file"
options:
max-size: "200m"
max-file: "10"
restart: unless-stopped
volumes:
timescale_data:
name: mev_timescale_data