-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
68 lines (64 loc) · 1.51 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
version: '3.9'
services:
app:
container_name: rhizome
build:
context: .
target: runtime_stage
args:
- NODE_ENV=${NODE_ENV}
- SERVER_PORT=${SERVER_PORT}
- DB_MIGRATIONS=${DB_MIGRATIONS}
volumes:
- content:/app/content
ports:
- ${SERVER_PORT}:${SERVER_PORT}
restart: always
env_file: .env
depends_on:
database:
condition: service_healthy
cache:
condition: service_healthy
database:
container_name: database
image: postgres:17
command: ['postgres', '-c', 'port=${DB_PORT}']
environment:
POSTGRES_DB: ${DB_SCHEMA}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
PG_DATA: /var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${DB_USERNAME} -p ${DB_PORT}']
interval: 5s
timeout: 5s
retries: 5
ports:
- ${DB_PORT}:${DB_PORT}
volumes:
- pgdata:/var/lib/postgresql/data
cache:
container_name: cache
image: redis:7.4.1
healthcheck:
test:
[
'CMD-SHELL',
'redis-cli -p ${REDIS_PORT} -a ${REDIS_PASSWORD} ping | grep PONG',
]
interval: 1s
timeout: 3s
retries: 5
command: redis-server --port ${REDIS_PORT} --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
ports:
- ${REDIS_PORT}:${REDIS_PORT}
restart: always
env_file: .env
volumes:
- cache:/data
volumes:
pgdata:
content:
cache:
driver: local