-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
42 lines (42 loc) · 968 Bytes
/
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
services:
pg:
platform: linux/x86_64
image: postgres:latest
restart: always
environment:
POSTGRES_USER: my_pg_user
POSTGRES_PASSWORD: my_pg_pass
POSTGRES_DB: my_pg_dbname
ports:
- 5432:5432
expose:
- 5432
volumes:
- pg:/var/lib/postgresql/data
# Load database schema from file ./database.sql
# - ./database.sql:/docker-entrypoint-initdb.d/database.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 3
redis:
image: redis:latest
restart: always
ports:
- 6379:6379
expose:
- 6379
command: redis-server --save 20 1 --loglevel warning --requirepass my_redis_pass
volumes:
- redis:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
volumes:
pg:
driver: local
redis:
driver: local