-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.local.yaml
55 lines (53 loc) · 1.41 KB
/
docker-compose.local.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
services:
postgres:
image: postgres:16.3-alpine3.20
container_name: passfort-storage
restart: unless-stopped
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
env_file:
- .env.local
environment:
POSTGRES_DB: "${DB_NAME}"
POSTGRES_USER: "${DB_USER}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${DB_NAME} -U ${DB_USER}" ]
interval: 10s
timeout: 5s
retries: 3
redis:
image: "redis:7.2-alpine"
container_name: passfort-cache
command:
- /bin/sh
- -c
# - Double dollars, so that the variable is not expanded by Docker Compose
# - Surround by quotes, so that the shell does not split the password
# - The ${variable:?message} syntax causes shell to exit with a non-zero
# code and print a message, when the variable is not set or empty
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
restart: unless-stopped
# expose:
# - 6379
ports:
- 6379:6379
env_file:
- .env.local
environment:
ALLOW_EMPTY_PASSWORD: no
REDIS_PASSWORD: "${REDIS_PASSWORD}"
volumes:
- redis:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3
volumes:
postgres:
driver: local
redis:
driver: local