Skip to content

Commit

Permalink
[docker] health check fixes (#3377)
Browse files Browse the repository at this point in the history
* health checks do not see traefik, need internal URLs

* -c not needed here

---------

Co-authored-by: David LeBauer <[email protected]>
  • Loading branch information
infotroph and dlebauer authored Sep 12, 2024
1 parent 75fc4de commit 584963f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ services:
- "traefik.http.services.bety.loadbalancer.server.port=8000"
- "traefik.http.routers.bety.rule=Host(`${TRAEFIK_HOST:-pecan.localhost}`) && PathPrefix(`/bety/`)"
healthcheck:
test: "curl --silent --fail http://localhost:8000/${RAILS_RELATIVE_URL_ROOT} > /dev/null || exit 1"
test: "curl --silent --fail http://localhost:8000/$${RAILS_RELATIVE_URL_ROOT} > /dev/null || exit 1"
interval: 10s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -190,7 +190,7 @@ services:
- pecan:/data
- pecan:/var/www/html/pecan/data
healthcheck:
test: "curl --silent --fail http://localhost/pecan/ > /dev/null || exit 1"
test: "curl --silent --fail http://localhost:8080/pecan > /dev/null || exit 1"
interval: 10s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -218,7 +218,7 @@ services:
volumes:
- pecan:/data
healthcheck:
test: "curl --silent --fail http://localhost:9999/monitor/ > /dev/null || exit 1"
test: "curl --silent --fail http://localhost:9999 > /dev/null || exit 1"
interval: 10s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -354,7 +354,7 @@ services:
- "traefik.http.routers.dbsync.middlewares=dbsync-stripprefix"
- "traefik.http.middlewares.dbsync-stripprefix.stripprefix.prefixes=/monitor"
healthcheck:
test: "curl --silent --fail http://localhost/dbsync/ > /dev/null || exit 1"
test: "curl --silent --fail http://localhost:3838 > /dev/null || exit 1"
interval: 10s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -386,7 +386,7 @@ services:
volumes:
- pecan:/data/
healthcheck:
test: "curl --silent --fail http://localhost/api/ping > /dev/null || exit 1"
test: "curl --silent --fail http://localhost:8000/api/ping > /dev/null || exit 1"
interval: 10s
timeout: 5s
retries: 5
Expand Down
2 changes: 1 addition & 1 deletion docker/data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ RUN apk --no-cache add bash curl rsync postgresql-client unzip \
&& curl -s -o create_met_driver.tar.gz http://isda.ncsa.illinois.edu/~kooper/EBI/create_met_driver.tar.gz

COPY add-data.sh add.util.sh /work/
CMD ["bash", "-c", "/work/add-data.sh"]
CMD ["bash", "/work/add-data.sh"]
5 changes: 5 additions & 0 deletions docker/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ RUN make build
# ----------------------------------------------------------------------
FROM httpd

# need curl for health checks
RUN apt-get update \
&& apt-get install -y curl \
&& rm -rf /var/lib/apt/lists/*

COPY docker/docs/index.html /usr/local/apache2/htdocs/
COPY --from=pecandocs /src/book_source/_book/ /usr/local/apache2/htdocs/docs/pecan/

Expand Down
2 changes: 1 addition & 1 deletion shiny/dbsync/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV PGHOST=postgres \
GEOCACHE=/srv/shiny-server/geoip.json

RUN apt-get update \
&& apt-get -y install libpq-dev libssl-dev \
&& apt-get -y install curl libpq-dev libssl-dev \
&& install2.r -e -s -n -1 curl dbplyr DT leaflet RPostgreSQL \
&& rm -rf /srv/shiny-server/* \
&& rm -rf /var/lib/apt/lists/*
Expand Down

0 comments on commit 584963f

Please sign in to comment.