fix: health check
This commit is contained in:
1 parent
03d9ded760
commit
c0bb215846
2 files changed
+8
-3
No files matched your search
+7
-1
@@ -28,6 +28,8 @@ ENV VERSION=$VERSION
|
|||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
RUN addgroup -g 1001 -S nodejs
|
RUN addgroup -g 1001 -S nodejs
|
||||||
RUN adduser -S nextjs -u 1001
|
RUN adduser -S nextjs -u 1001
|
||||||
|
|
||||||
@@ -52,4 +54,8 @@ ENV PORT=3000
|
|||||||
# Uncomment the following line in case you want to disable telemetry.
|
# Uncomment the following line in case you want to disable telemetry.
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
ENV HOSTNAME=0.0.0.0
|
||||||
|
|
||||||
|
CMD ["node", "server.js"]
|
||||||
|
|
||||||
|
HEALTHCHECK CMD curl --fail http://localhost:3000/api/health || exit 1
|
||||||
+1
-2
@@ -9,8 +9,7 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 40s
|
start_period: 10s
|
||||||
Reference in new issue
Block a user