-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
77 lines (76 loc) · 1.59 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
69
70
71
72
73
74
75
76
77
version: "3.4"
services:
redis:
image: redis:alpine3.18
volumes:
- "redis_data:/data"
restart: always
healthcheck:
test: [ "CMD-SHELL", "redis-cli -h 127.0.0.1 -p 6379" ]
interval: 10s
timeout: 5s
retries: 5
ports:
- 6379:6379
deploy:
resources:
limits:
memory: '512M'
cpus: '1'
postgres:
image: postgres:alpine3.18
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U groot" ]
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_PASSWORD: groot
POSTGRES_USER: groot
POSTGRES_DB: groot
volumes:
- "pg_data:/var/lib/postgresql"
ports:
- 5432:5432
deploy:
resources:
limits:
memory: '512M'
cpus: '1'
groot_api:
container_name: groot_api
build:
context: .
dockerfile: Dockerfile
cache_from:
- rust:latest
links:
- postgres
- redis
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
SERVER.HOST: 0.0.0.0
SERVER.PORT: 3030
DATABASE_URL: postgres://groot:groot@postgres:5432/groot
REDIS_URL: redis://redis:6379
volumes:
- "groot:/content"
deploy:
resources:
limits:
memory: '1G'
cpus: '2'
ports:
- 3030:3030
volumes:
groot:
name: groot${DEV_VOLUME_SUFFIX:-dev}
pg_data:
name: pg_data${DEV_VOLUME_SUFFIX:-dev}
redis_data:
name: redis_data${DEV_VOLUME_SUFFIX:-dev}