-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
56 lines (53 loc) · 1.21 KB
/
docker-compose.yaml
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
services:
app:
container_name: gymetry-app
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- /app/node_modules # prevents node_modules from being re-mounted on each run
environment:
- DATABASE_URL=postgres://postgres:mysecretpassword@db:5432/gymetry
env_file:
- .env
ports:
- 3000:3000
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
db:
container_name: gymetry-db
image: postgres:alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: gymetry
ports:
- 5432:5432
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
redis:
container_name: gymetry-redis
image: redis:alpine
ports:
- 6379:6379
volumes:
- redis-data:/var/lib/redis
healthcheck:
test: ["CMD", "redis-cli", "ping"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres-data:
redis-data: