Skip to content

Commit 86db05a

Browse files
committed
#68 Consul discovers databases
1 parent d830767 commit 86db05a

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

backend/consul/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ COPY ./config/itmo-dating-backend.crt /consul/config/itmo-dating-backend.crt
55
COPY ./config/itmo-dating-backend-ca.crt /consul/config/itmo-dating-backend-ca.crt
66
COPY ./config/consul.hcl /consul/config/consul.hcl
77

8-
COPY run.sh /consul/run.sh
8+
COPY ./run.sh /consul/run.sh
99

1010
RUN chmod -R 755 /consul/config && \
1111
chmod 644 /consul/config/itmo-dating-backend.key && \

backend/consul/config/consul.hcl

+39
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,42 @@ tls_min_version = "TLSv1_3"
2525
key_file = "/consul/config/itmo-dating-backend.key"
2626
cert_file = "/consul/config/itmo-dating-backend.crt"
2727
ca_file = "/consul/config/itmo-dating-backend-ca.crt"
28+
29+
services = [
30+
{
31+
name = "authik-database"
32+
address = "authik-database"
33+
port = 5432
34+
check = {
35+
id = "authik-database-check"
36+
name = "Authik PostgreSQL Health Check"
37+
tcp = "authik-database:5432"
38+
interval = "10s"
39+
timeout = "1s"
40+
}
41+
},
42+
{
43+
name = "matchmaker-database"
44+
address = "matchmaker-database"
45+
port = 5432
46+
check = {
47+
id = "matchmaker-database-check"
48+
name = "Matchmaker PostgreSQL Health Check"
49+
tcp = "matchmaker-database:5432"
50+
interval = "10s"
51+
timeout = "1s"
52+
}
53+
},
54+
{
55+
name = "people-database"
56+
address = "people-database"
57+
port = 5432
58+
check = {
59+
id = "people-database-check"
60+
name = "People PostgreSQL Health Check"
61+
tcp = "people-database:5432"
62+
interval = "10s"
63+
timeout = "1s"
64+
}
65+
},
66+
]

0 commit comments

Comments
 (0)