kartoza / docker-geoserver

A docker recipe for GeoServer
GNU General Public License v2.0
625 stars 424 forks source link

docker-compose geoserver unhealthy #124

Closed ErinKenna closed 4 years ago

ErinKenna commented 4 years ago

https://github.com/kartoza/docker-geoserver/blob/fb1ccdf1bae5f7e74e0b346808b6b997ceeef178/docker-compose.yml#L34

(I'm currently running several commits behind @ https://github.com/kartoza/docker-geoserver/commit/dc583dec27a6efc0f52de383c3344ab9f5f27fbb )

When I use a docker-compose instance the geoserver container seems to be persistently unhealthy when I look at the status from docker ps.

I had a look at the health check in the docker-compose.yml. Geoserver container 8080 is exposed on my host machine as 8600. I tried the following manually.

$ curl --fail -s http://localhost:8600/ || echo FAILED 
> FAILED
$ curl --head http://localhost:8600 
HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Language: en
Transfer-Encoding: chunked
Date: Wed, 15 Jan 2020 05:17:54 GMT
$ curl --head http://localhost:8600/geoserver
HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
X-Frame-Options: SAMEORIGIN
Location: /geoserver/index.html
Transfer-Encoding: chunked
Date: Wed, 15 Jan 2020 05:18:08 GMT
$ curl --fail -s http://localhost:8600/geoserver || echo FAILED

So I'm wondering if curl --fail -s http://localhost:8080/geoserver || exit 1 might work better for the health check? Seems to be working for me but haven't left it running for long.

NyakudyaA commented 4 years ago

Hi @ErinKenna You need to check the documentation for docker. Healthcheck checks for internal ports, not the exposed port.