libertysoft3 / saidit

The reddit open source fork powering SaidIt
https://saidit.net
Other
226 stars 40 forks source link

Some Docker suggestions #118

Open yarons opened 2 years ago

yarons commented 2 years ago

Building Dockers is usually needed when there are some big changes or that it is a custom app in the heart of the system that needs some special care but in most cases creating and actual Docker for each service that already has an official Docker it's somewhat bad practice.

I think that the first step should be eliminating all the Dockerfiles and using the official images instead, all the changes in terms of adding files, changing files, manipulating environment variables, etc. can be done directly using the docker-compose.yml.

As for postgres: there's a special "init" dir that is used exactly for cases like yours where some data should be preloaded to the database. Nginx: it's a great tool, don't get me wrong but implementing Caddy instead will ease the configuration in terms of acquiring an SSL certificate for the deployment. Ubuntu 14: Sadly EOL and there's no reason to use Mcrouter like that, there's an official image, there's a very easy config option: --config-str= that can be called using docker-compose (command, not entrypoint). Docker has an internal health monitoring mechanism, I'm not sure what cron and supervisord are used for in the "reddit" docker.

The biggest disadvantage in my suggestions is that some of these containers does not support architectures other than amd64, for the rest, it saves a lot of headaches. I'd love to help if you think these suggestions are appropriate and fit the project's goal.

libertysoft3 commented 2 years ago

Hello and thank you for this great feedback. I am very open to improvements and will accept working pull requests.

I did try to use official images where possible, but Reddit made a lot of modifications to things like mcrouter, which means I can't use an existing image for it. However each modification that Reddit made could be analyzed in detail and potentially removed.

Your postgres improvement ideas seem very do-able though.