Skip to content

Commit

Permalink
docker: Add HEALTHCHECK to Dockerfile (#508)
Browse files Browse the repository at this point in the history
i added the healthcheck to the AIO and legacy web container. 

checked on my AIO instance:

```
{
   "Status":"healthy",
   "FailingStreak":0,
   "Log":[
      {
         "Start":"2024-10-07T21:23:19.83382568+02:00",
         "End":"2024-10-07T21:23:20.003640388+02:00",
         "ExitCode":0,
         "Output":"Connecting to 127.0.0.1:3000 (127.0.0.1:3000)\nremote file exists\n"
      }
   ]
}
```
  • Loading branch information
wuast94 authored Oct 7, 2024
1 parent 904eb5a commit e2644eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,17 @@ RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/init-db-migration \
/etc/s6-overlay/s6-rc.d/user/contents.d/svc-web \
/etc/s6-overlay/s6-rc.d/user/contents.d/svc-workers

HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:3000/api/health || exit 1

################# The web container ##############

FROM aio_builder AS web

RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/init-db-migration \
/etc/s6-overlay/s6-rc.d/user/contents.d/svc-web

HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:3000/api/health || exit 1

################# The workers container ##############

FROM aio_builder AS workers
Expand Down

0 comments on commit e2644eb

Please sign in to comment.