-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (50 loc) · 1.29 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
version: '3'
services:
fortune-cookie-reader:
build:
context: .
dockerfile: ./docker/Dockerfile.app
environment:
- TWILIO_ACCOUNT_SID=${TWILIO_ACCOUNT_SID}
- TWILIO_AUTH_TOKEN=${TWILIO_AUTH_TOKEN}
- TWILIO_FROM_PHONENUMBER=${TWILIO_FROM_PHONENUMBER}
- FORTUNE_COOKIE_API_KEY=${FORTUNE_COOKIE_API_KEY}
- INTERVAL=43200
depends_on:
fortune-cookie-server:
condition: service_healthy
fortune-cookie-server:
build:
context: .
dockerfile: ./docker/Dockerfile.api
ports:
- "80:80"
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/fortune_cookie
- API_KEY=${FORTUNE_COOKIE_API_KEY}
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:80/health" ]
interval: 5s
timeout: 5s
retries: 5
postgres:
image: postgres:latest
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: fortune_cookie
volumes:
- database:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
volumes:
database:
driver: local