erseco / alpine-php-webserver

Docker image with Nginx & PHP-FPM on Alpine Linux
https://hub.docker.com/r/erseco/alpine-php-webserver
MIT License
49 stars 26 forks source link

Just a question #27

Closed MarcHagen closed 1 month ago

MarcHagen commented 1 month ago

Hi 👋🏻

I came across your repo in search of a multi-process PHP container. And yours looks like what I need. Just curious why you chose to use runit as the init process instead of s6 or monit for example? (personally never done stuff with runit before)

Maybe if the reason is interesting enough, you could add that to your very complete readme (I love it!)

erseco commented 1 month ago

Hi @MarcHagen

Thank you for reaching out and for your kind words about the repository and its README!

Regarding your question about why I chose to use runit as the init process instead of s6 or monit, here's an explanation of the differences and the rationale behind this choice.

Differences between runit, s6, and monit:

  1. runit:

    • Lightweight and Fast: runit is known for being lightweight and fast with a very low memory footprint.
    • Simple Configuration: It has a straightforward and simple configuration syntax, which makes it easy to use and maintain.
    • Process Supervision: runit provides reliable process supervision and ensures that services are restarted if they crash.
  2. s6:

    • Modular Design: s6 is highly modular, allowing you to pick and choose the components you need.
    • Complexity: While powerful, s6 can be more complex to configure and manage due to its modular nature.
    • Extensibility: It provides a lot of extensibility and can handle more complex setups with ease.
  3. monit:

    • Monitoring and Managing: monit is primarily designed for monitoring and managing processes, files, directories, and devices on a Unix system.
    • Configuration: It has a more complex configuration and is generally used for monitoring system performance and status.
    • Web Interface: monit includes a web interface for easy management and monitoring, which might be overkill for simple container use cases.

Reason for Choosing runit:

I opted for runit due to its simplicity and efficiency. In the context of a Docker container where we want to keep things lightweight and ensure reliable service supervision, runit offers an excellent balance of features and ease of use. Additionally, its low memory footprint is particularly advantageous in containerized environments.

The original TrafeX version of the repository uses supervisor, which is written in Python. While supervisor is robust and widely used, I wanted to maintain a fork that uses runit to provide an alternative that might better suit certain use cases where a lightweight and simple init system is preferable.

For more context, you can refer to this PR I did on the original repo, which discusses the transition from supervisor to runit and the benefits associated with this change.

If you have any suggestions or would like to improve the README, feel free to send a PR. I would be happy to merge it. Thanks!

Best regards,
Ernesto