-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
155 lines (140 loc) · 4.08 KB
/
Copy pathcompose.yaml
File metadata and controls
155 lines (140 loc) · 4.08 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
networks:
auth:
name: auth
driver: bridge
volumes:
database-1:
name: auth-database-1
database-2:
name: auth-database-2
database-3:
name: auth-database-3
cache:
name: auth-cache
x-db-common: &db-common
image: "cockroachdb/cockroach:latest-v26.2"
restart: always
networks:
auth:
services:
database-1:
<<: *db-common
container_name: auth-database-1
command: start --certs-dir=certs --listen-addr=auth-database-1:26357 --sql-addr=auth-database-1:26257 --join=auth-database-1:26357,auth-database-2:26357,auth-database-3:26357
volumes:
- database-1:/cockroach/cockroach-data
- ./cockroach/certs:/cockroach/certs:ro
database-2:
<<: *db-common
container_name: auth-database-2
command: start --certs-dir=certs --listen-addr=auth-database-2:26357 --sql-addr=auth-database-2:26257 --join=auth-database-1:26357,auth-database-2:26357,auth-database-3:26357
volumes:
- database-2:/cockroach/cockroach-data
- ./cockroach/certs:/cockroach/certs:ro
depends_on:
database-1:
condition: service_started
database-3:
<<: *db-common
container_name: auth-database-3
command: start --certs-dir=certs --listen-addr=auth-database-3:26357 --sql-addr=auth-database-3:26257 --join=auth-database-1:26357,auth-database-2:26357,auth-database-3:26357
volumes:
- database-3:/cockroach/cockroach-data
- ./cockroach/certs:/cockroach/certs:ro
depends_on:
database-2:
condition: service_started
init-cluster:
image: "cockroachdb/cockroach:latest-v26.2"
container_name: auth-database-init
command: init --certs-dir=certs
networks:
auth:
volumes:
- ./cockroach/certs:/cockroach/certs:ro
depends_on:
database-1:
condition: service_started
environment:
COCKROACH_HOST: auth-database-1:26357
migrate-cluster:
image: "cockroachdb/cockroach:latest-v26.2"
container_name: auth-database-migrate
command: sql --certs-dir=certs --file "/cockroach/migrations.sql"
networks:
auth:
volumes:
- ./cockroach/certs:/cockroach/certs:ro
- ./cockroach/migrations.sql:/cockroach/migrations.sql:ro
depends_on:
database-1:
condition: service_started
environment:
COCKROACH_HOST: auth-database-1:26257
seed-cluster:
image: "cockroachdb/cockroach:latest-v26.2"
container_name: auth-database-seed
command: sql --certs-dir=certs --file "/cockroach/seeding.sql"
networks:
auth:
volumes:
- ./cockroach/certs:/cockroach/certs:ro
- ./cockroach/seeding.sql:/cockroach/seeding.sql:ro
depends_on:
database-1:
condition: service_started
migrate-cluster:
condition: service_completed_successfully
environment:
COCKROACH_HOST: auth-database-1:26257
cache:
image: valkey/valkey:9.0-alpine
container_name: auth-cache
entrypoint: valkey-server --appendonly yes --save 60 1
networks:
auth:
healthcheck:
test: ["CMD", "valkey-cli", "-h", "127.0.0.1", "-p", "6379", "PING"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
volumes:
- cache:/data
api:
image: ghcr.io/botprzemek/auth/api:latest
build: ./api
container_name: auth-api
networks:
auth:
volumes:
- ./cockroach/certs:/certs:ro
depends_on:
cache:
condition: service_started
environment:
API_SERVER_HOST: 0.0.0.0
API_SERVER_PORT: 3000
API_TOKEN_ISSUER: auth
API_TOKEN_SECRET: your-secret
API_DATABASE_HOST: auth-database-1
API_DATABASE_PORT: 26257
API_DATABASE_NAME: dev
API_DATABASE_USERNAME: dev
API_DATABASE_PASSWORD: your-password
API_CACHE_HOST: auth-cache
API_CACHE_PORT: 6379
app:
image: ghcr.io/botprzemek/auth/app:latest
build: ./app
container_name: auth-app
networks:
auth:
depends_on:
api:
condition: service_started
environment:
NITRO_HOST: 0.0.0.0
NITRO_PORT: 3001
NUXT_APP_BASE_URL: /
NUXT_PUBLIC_API_URL: http://localhost:3000