Setup Docker development environment with Solid Queue #2222
+97
−46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
To simplify local development and ensure consistency across different environments by using Docker. Additionally, switching to Solid Queue for background jobs provides a database-backed queuing system that is easier to manage in a local development environment without requiring Redis.
What’s included
docker-compose.ymlfile to orchestrate the application, MySQL database, and a worker process.Dockerfile.devand.dockerignorefor efficient container builds.config/database.mysql.yml.ActiveJobto useSolid Queuein the development environment.Usage
docker-compose upto start the application, database, and worker.http://fizzy.localhost:3006.Configuration
docker-compose.ymluses environment variables for database connection details.config/environments/development.rbnow specifiessolid_queueas the queue adapter.Notes
GITHUB_TOKENsecret is required for the build process if private gems are used.db/*_migratedirectories were added to support Rails' multi-database migrations.