Skip to content

Commit

Permalink
Docker add HEALTHCHECK directly in the image
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Feb 11, 2025
1 parent a20618a commit b0f8bed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README-DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ services:
timeout: 10s
```

Replace USER with your user name (i.e. ubuntu or pi).
Replace USER with your user name (i.e. ubuntu or pi: "/home/ubuntu/Matterbridge:/root/Matterbridge").

copy it in the home directory or edit the existing one to add the matterbridge service.

Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ COPY --from=builder /matterbridge-eve-room/*.tgz .
COPY --from=builder /matterbridge-eve-weather/*.tgz .
RUN npm install -g --omit=dev *.tgz && rm *.tgz && node -v && npm -v && npm list -g && npm cache clean --force && rm -rf /tmp/* /var/tmp/* /root/.npm /root/.cache && apt-get clean && rm -rf /var/lib/apt/lists/*

# Add Docker HEALTHCHECK
HEALTHCHECK --interval=60s --timeout=10s --start-period=60s --retries=5 \
CMD curl --fail http://localhost:8283/health || exit 1

CMD ["matterbridge", "-docker"]
4 changes: 4 additions & 0 deletions docker/Dockerfile.main
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@ RUN npm install -g --omit=dev matterbridge-eve-energy
RUN npm install -g --omit=dev matterbridge-eve-room
RUN npm install -g --omit=dev matterbridge-eve-weather

# Add Docker HEALTHCHECK
HEALTHCHECK --interval=60s --timeout=10s --start-period=60s --retries=5 \
CMD curl --fail http://localhost:8283/health || exit 1

WORKDIR /app
CMD ["matterbridge", "-docker"]

0 comments on commit b0f8bed

Please sign in to comment.