-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (43 loc) · 999 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
44 lines (43 loc) · 999 Bytes
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
version: '3.8'
services:
db:
image: postgres:latest
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: mydb
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d mydb"]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
api:
build:
context: .
dockerfile: dockerfile
target: runner
ports:
- "5000:5000"
depends_on:
db:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5000/api || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
environment:
DATABASE_URL: postgres://user:password@db/mydb
PORT: 5000
NODE_ENV: testing
GOOGLE_CLIENT_ID: your_google_client_id
GOOGLE_CLIENT_SECRET: your_google_client_secret
volumes:
pgdata: