reacherhq / backend

⚙️ REST backend for Reacher - Open-Source Email Verification API.

Home Page:https://reacher.email

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More solid dockerfile with a supervisor

FedericoPonzi opened this issue · comments

Hello,

I'm not sure if you're still using this file: https://github.com/reacherhq/backend/blob/master/scripts/docker_entrypoint.sh
but apparently, it looks you're running two program in one container.
I've been working for a while on a new supervisor called Horust, and I'm looking for some initial users. I've stumbled upon this project a while ago (I think it was on HN?), and I think it might be a good candidate for horust (or, well, a supervisor in general).
The reason is if for whatever reason TOR service dies, it won't be restarted automatically. reacher requests will start failing, and I think you don't have a way to restart TOR from reacher, the only way to get everything working again would be to exit reacher, and let some other supervisor outside the container (docker compose or similar) to restart the failed container.

With horust, you need to:

  • create one toml file for each service, and declare dependencies between them
  • Start horust, which will take care of running your services and keep them running.
    I can help writing those toml files, and update the dockerfile accordingly. There is also a docker image with horust already baked in, so you would need just to verify that everything works and merge the pr.

Even if you choose not going with horust, I would suggest to either split the two components in two different containers, or use another supervisor like supervisord.
Best,
Federico

Hey @FedericoPonzi, thanks for your message! I ended up not using that docker entry point file, and splitted the 2 components.

Right now the main codebase is deployed on Heroku, and the Tor container is deployed separately. I'm not sure how a supervisor would help in this case. If you can convince me of the usefulness of a supervisor, I can consider Horust.

Hey Amauri, thanks a lot for your comment and sorry for the late response.

I'm trying to look for beta users for Horust and the use case I had in mind is when you're running two services inside the same docker container, as described here.

In that page, Docker docs suggest to use supervisord. I'm trying to get some users to use Horust instead.

In your case, since you're running the two services in two different containers (which is usually something worth doing), than you probably don't need Horust at this point. Thanks a lot for your comment though, I will keep looking for some users :) good luck for Reacher!