rnwood / smtp4dev

smtp4dev - the fake smtp email server for development and testing
BSD 3-Clause "New" or "Revised" License
2.94k stars 334 forks source link

Docker healthckeck mechanism #1514

Open midgethoen opened 1 month ago

midgethoen commented 1 month ago

I ran into an issue where my container healthcheck is no longer working because curl is not on the image.

  # docker-compose.yml
  ...
  smtpstub:
    image: rnwood/smtp4dev:3.1.1
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:80']
  ...

curl may have gone for a while, but i must have only now noticed after pulling a newer version.

i need the healthcheck to make sure smtp4dev is running before running any tests.

my current workaround is to simply to pin an older version, but that is not a real solution.

I'm not very familiar with dotnet, so maybe im overlooking on obvious solution.