-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
53 lines (52 loc) · 1.12 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
version: '3.9'
services:
project:
build:
context: .
dockerfile: Dockerfile
restart: always
volumes:
- ./image:/image
ports:
- "8080:8080"
depends_on:
- db
db:
image: postgres:latest
ports:
- "5432:5432"
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- DATABASE_HOST=${DB_HOST}
volumes:
- postgres_data:/var/lib/postgresql/vk_app_data
expose:
- 5432
healthcheck:
test: "pg_isready --username=postgres && psql --username=postgres --list"
timeout: 10s
retries: 20
redis:
image: redis:latest
ports:
- "6379:6379"
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_USER=${REDIS_USER}
- REDIS_USER_PASSWORD=${REDIS_USER_PASSWORD}
volumes:
- ./redisdata:/data
expose:
- 6379
healthcheck:
test: ["CMD", "redis-cli", "-a", "$REDIS_PASSWORD", "ping"]
interval: 30s
timeout: 10s
retries: 5
restart: always
tty: true
stdin_open: true
volumes:
postgres_data: