File tree Expand file tree Collapse file tree 5 files changed +35
-14
lines changed Expand file tree Collapse file tree 5 files changed +35
-14
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,10 @@ USER root
4
4
RUN corepack enable
5
5
USER node
6
6
7
- RUN pnpm install directus-extension-blurhasher
7
+ WORKDIR /directus
8
+
9
+ COPY healthcheck.mjs ./healthcheck.mjs
10
+
11
+ RUN pnpm install directus-extension-blurhasher
12
+
13
+ HEALTHCHECK --interval=12s --timeout=12s --start-period=30s CMD node healthcheck.mjs
Original file line number Diff line number Diff line change
1
+ import https from "https" ;
2
+
3
+ https . get ( "https://www.data.rabe.ch/server/health" , res => {
4
+ console . log ( `STATUS: ${ res . statusCode } ` ) ;
5
+ return process . exit (
6
+ res . statusCode === 200 ? 0 : 1
7
+ ) }
8
+ ) . on ( "error" , ( err ) => {
9
+ console . log ( 'ERROR: ' , err ) ;
10
+ process . exit ( 1 )
11
+ }
12
+ ) ;
Original file line number Diff line number Diff line change @@ -20,12 +20,6 @@ services:
20
20
depends_on :
21
21
directus :
22
22
condition : service_healthy
23
- healthcheck :
24
- test : wget --no-verbose --tries=1 --spider ${NEXT_PUBLIC_FE_URL}/api/healthcheck || exit 1
25
- start_period : 15s
26
- interval : 15s
27
- timeout : 15s
28
- retries : 3
29
23
30
24
directus :
31
25
container_name : rabe-directus
@@ -41,9 +35,3 @@ services:
41
35
- ./directus/migrations:/directus/migrations
42
36
env_file : .env
43
37
restart : unless-stopped
44
- healthcheck :
45
- test : wget --no-verbose --tries=1 --spider ${NEXT_PUBLIC_BE_URL}/server/health || exit 1
46
- start_period : 15s
47
- interval : 15s
48
- timeout : 15s
49
- retries : 3
Original file line number Diff line number Diff line change @@ -67,4 +67,7 @@ ENV PORT=3000
67
67
# server.js is created by next build from the standalone output
68
68
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
69
69
ENV HOSTNAME="0.0.0.0"
70
- CMD ["node", "server.js"]
70
+ CMD ["node", "server.js"]
71
+
72
+ COPY healthcheck.mjs ./healthcheck.mjs
73
+ HEALTHCHECK --interval=12s --timeout=12s --start-period=30s CMD node healthcheck.mjs
Original file line number Diff line number Diff line change
1
+ import https from "https" ;
2
+
3
+ https . get ( "https://www.rabe.ch/api/healthcheck" , res => {
4
+ console . log ( `STATUS: ${ res . statusCode } ` ) ;
5
+ return process . exit (
6
+ res . statusCode === 200 ? 0 : 1
7
+ ) }
8
+ ) . on ( "error" , ( err ) => {
9
+ console . log ( 'ERROR: ' , err ) ;
10
+ process . exit ( 1 )
11
+ }
12
+ ) ;
You can’t perform that action at this time.
0 commit comments