Notice: the project is not yet fully implemented.
A template Rails project with Web And Worker Dockerized in single container.
Especially useful to run on Heroku in scope of single dyno. Such approach will relieve you from running additional Worker node.
Meaning you can even run the application on free dyno and keep processing background jobs.
Find more detailed explanation here:
Dockerized Rails with Background Worker in single container
- Adapted to run on Heroku in Docker Deployment Mode
- Included docker-compose.yml for running with Docker Compose in self-hosted environment
- Configured for default Heroku Postgres database;
- Configured to cache gems in case of running with Docker Compose;
- Entrypoint script with automatic migrations run and DB creation when needed;
- Configured supervisord to run multiple processes in single container;
- Installed and configured DelayedJob
- Installed a UI for DelayedJob delayed_job_web
docker-compose up
...
Follow instructions gere to configure your Heroku app for Docker deployment: https://devcenter.heroku.com/articles/build-docker-images-heroku-yml
Notice:
Remember to add:
config.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT))
to config/application.rb
in order to allow Puma to write request logs into STDOUT
(TODO) Run in development: ...