-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
126 lines (111 loc) · 2.53 KB
/
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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: "3.9"
networks:
default:
name: Gojo-Network
external: false
volumes:
data-volume:
name: Gojo-Volume
driver: local
services:
postgres:
container_name: Gojo-DB
image: postgres:16.2-alpine3.19
restart: unless-stopped
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=gojo_secret
- POSTGRES_DB=gojo
ports:
- "5432:5432"
volumes:
- data-volume:/var/lib/postgresql/data
networks:
- default
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -h postgres'"]
interval: 10s
timeout: 3s
retries: 3
queue:
container_name: Gojo-Redis-Queue
image: redis:7.2.4-alpine3.19
restart: unless-stopped
environment:
- REDIS_PORT=6370
networks:
- default
ports:
- "6370:6370"
command: redis-server --port 6370
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 1s
timeout: 3s
retries: 5
cache:
container_name: Gojo-Redis-Cache
image: redis:7.2.4-alpine3.19
restart: unless-stopped
environment:
- REDIS_PORT=6380
networks:
- default
ports:
- "6380:6380"
command: redis-server --port 6380
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 1s
timeout: 3s
retries: 5
meili:
container_name: Gojo-Meilisearch
image: getmeili/meilisearch:v1.6.0-rc.5
restart: unless-stopped
networks:
- default
ports:
- "7700:7700"
migration:
container_name: Gojo-Migration
build:
context: .
dockerfile: Dockerfile.migrate
environment:
- DB_SOURCE=postgresql://root:gojo_secret@postgres:5432/gojo?sslmode=disable
networks:
- default
depends_on:
postgres:
condition: service_healthy
restart: true
api:
container_name: Gojo-Api
build:
context: .
dockerfile: Dockerfile.api
ports:
- "8080:8080"
- "9090:9090"
environment:
- DB_NAME=gojo
- DB_USER=root
- DB_PASSWORD=gojo_secret
- DB_HOST=postgres
- DB_PORT=5432
- REDIS_QUEUE_ADDRESS=queue:6370
- REDIS_CACHE_ADDRESS=cache:6380
- MEILISEATCH_ADDRESS=meili:7700
networks:
- default
restart: unless-stopped
depends_on:
migration:
condition: service_completed_successfully
postgres:
condition: service_healthy
queue:
condition: service_started
cache:
condition: service_started