Skip to content

Commit 4520172

Browse files
committed
Add health checks for every service
1 parent bb6b3ed commit 4520172

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

caddy/Caddyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
-Server
3030
}
3131

32-
@api path /v1/*
32+
@api path /v1/* /status
3333
handle @api {
3434
reverse_proxy api:80
3535
}

docker-compose.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ services:
1717
depends_on:
1818
- web
1919
- api
20+
healthcheck:
21+
test: ["CMD", "curl", "-f", "http://localhost/status"]
22+
interval: 30s
23+
timeout: 10s
24+
retries: 3
25+
start_period: 10s
2026
web:
2127
build:
2228
context: ./hdrop-web-next
@@ -64,7 +70,7 @@ services:
6470
condition: service_healthy
6571
required: false
6672
healthcheck:
67-
test: ["CMD", "curl", "-f", "http://localhost/status"]
73+
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/status"]
6874
volumes:
6975
- local_storage:/data/hdrop-files
7076
- cache_data:/cache/hdrop
@@ -97,6 +103,12 @@ services:
97103
- backend
98104
volumes:
99105
- ./prometheus:/etc/prometheus
106+
healthcheck:
107+
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9090/-/healthy"]
108+
interval: 30s
109+
timeout: 10s
110+
retries: 3
111+
start_period: 10s
100112
networks:
101113
hdrop:
102114
backend:

hdrop-server/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ FROM node:25-alpine
2626

2727
WORKDIR /app
2828

29-
RUN apk add --no-cache ca-certificates libgcc openssl postgresql-libs \
30-
&& npm i -g pm2@latest
29+
RUN apk add --no-cache ca-certificates libgcc openssl postgresql-libs
30+
RUN npm i -g pm2@latest
3131

3232
COPY --from=builder /app/target/release/hdrop-server /usr/local/bin/hdrop-server
3333
COPY --from=builder /usr/local/cargo/bin/diesel /usr/local/bin/diesel

0 commit comments

Comments
 (0)