-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dev Containers Docker Development Environment #203
base: main
Are you sure you want to change the base?
Add Dev Containers Docker Development Environment #203
Conversation
Hi there. Since the book has gone to print, I want to keep the installation instructions the same as they are. In other words, I don't want to introduce any changes to the main README.md beyond changes that are spelling or grammar related. However, if you'd like to submit a guide, I'm open to that. I would call it an alternative method for running Rideshare for development purposes, using Dev Containers, and make it clear that it's submitted by the community and not the officially supported method described in the book. I'm open to additional alternatives like that including Windows and Linux installation instructions, but I do feel we missed the window of time before the book went to print, to support multiple installation methods and for them to be rigorously tested. Hopefully that makes sense. With that said, I hope to try out your instructions myself in the future and can report back on my experience. Thanks. |
Hi @andyatkinson, I've reverted the main As I do not have time to test this setup on Windows, and also do not have a Linux environment up and running, I would suggest that someone from the community could contribute by adding and testing instructions for these platforms. Additionally, using Dev Containers simplifies the process of running the setup on any operating system, making it more accessible and consistent across different development environments. Thank you for the feedback, and I hope this guide will be helpful for others who prefer using Dev Containers for their development environment. |
Thank you for that. I don't know when, but I'll try and review it. If any other people review the instructions and validate them, that would help as well. Another direction that I'd consider is that I've kept a bunch of additional installation instructions in a companion repo called "development_guides" that's mentioned in the book as well. https://github.com/andyatkinson/development_guides Finally, if you'd prefer, you're also welcome to write a blog post on your own site and describe your process of setting it up. That allows you to release something on your own timeline and to your own preferences without waiting for me to review it. I'm also tracking the arrival of generated Dev Containers config in Rails 7.2 and I'm curious to see whether that increases adoption of Dev Containers. I did try them a bit myself on a test Rails project which I'll be writing more about soon. |
Summary
This pull request introduces a comprehensive Docker-based development environment for the Rideshare application, enhancing developer productivity and ensuring a consistent setup across various environments. Key features include DevContainers configuration, PostgreSQL setup, and automatic database initialization.
Changes
DevContainer Configuration:
.devcontainer/devcontainer.json
to define the development container environment.Docker Compose Integration:
compose.yml
to define services for the application and PostgreSQL.Environment Setup:
devcontainer.json
for database connections.Database Configuration:
Benefits
How to Test
References
Remarks
I recently started reading the book "High Performance PostgreSQL for Rails" (thanks a lot for the great book! 🥇) and was disappointed to find that I had to spend hours setting up the environment before I could start working on the exercises.
This pull request aims to streamline the setup process, allowing you to get started more quickly. However, please note that I have not tested all features yet, as I have only reached the section where I need to create millions of rows in the database.
This PR is just the first step, from which we could start to improve the setup.