plantuml / plantuml-server

PlantUML Online Server
https://plantuml.com/
GNU General Public License v3.0
1.6k stars 462 forks source link

Keep `curl` in the image so it can be used for healthchecks in docker-compose #273

Closed mcbeelen closed 1 year ago

mcbeelen commented 1 year ago

Feature request

While running 2 service via docker compose, where one is the plantuml-server and the other depends on the plantuml-server, I want to have a healthcheck on the plantuml-server.

Most suggestions for healthcheck suggest using curl or wget, but neither are present in the images.

version: "3.0"

services:

  plantuml-server:
    image: "plantuml/plantuml-server"
    ports:
      - "8080:8080"
    healthcheck:
      test: curl --fail http://localhost:8080/png/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vt98pKi1IW80 || exit 1
      interval: 2s
      timeout: 3s
      retries: 5

  hello:
    image: "hello-world"
    depends_on:
      plantuml-server:
        condition: service_healthy

Output

dependency failed to start: container plantuml-plantuml-server-1 is unhealthy

Proposed solution

Currently the Dockerfile contains an instruction to run apt-get remove -y curl, which makes curl unavailable. My suggestion is to stop that remove.

Alternatives

Currently I build my own image on top of plantuml-server, where I reinstall curl.

My Dockerfile

FROM plantuml/plantuml-server:jetty

USER root
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        curl

USER jetty

Additional context

220