Skip to content
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

Implement Docker Support for Simplified Development Environment Setup #348

Open
aaronbrethorst opened this issue Feb 26, 2024 · 3 comments

Comments

@aaronbrethorst
Copy link
Member

aaronbrethorst commented Feb 26, 2024

Why Docker?

Our current development setup for OBA presents several challenges that can hinder productivity and create barriers for new contributors. These challenges include:

  • Complex Dependency Management: The app requires a specific set of dependencies, which can vary across development environments. This often leads to the "works on my machine" problem, where the app runs on one developer's machine but not on another's due to slight differences in the environment or installed versions.
  • Time-Consuming Setup: Setting up the development environment from scratch involves multiple steps, including installing Java, Spring dependencies, and other tools. This process is not only time-consuming but also prone to errors, leading to further delays.
  • Database Integration: The app needs to be connected to a database for development and testing. Setting up a local database and configuring the app to connect to it can be complicated and error-prone, especially for new developers or when switching between projects.
  • Environment Consistency: Ensuring a consistent development environment across all team members and CI/CD pipelines is crucial for eliminating bugs that occur due to environment discrepancies. However, achieving this consistency manually is challenging.

How Docker Can Help

Docker can address these challenges by containerizing the application and its environment. With Docker, we can:

  • Ensure Environment Consistency: Docker containers package the application along with its environment and dependencies, ensuring that it runs the same way on every machine.
  • Simplify Setup: Developers can get started with just Docker installed on their machine, without the need to manually install and configure various dependencies.
  • Streamline Database Integration: Using docker-compose, we can define and run multi-container Docker applications, including our app and its database, with simple commands.
  • Facilitate Development and Testing: Docker makes it easy to spin up isolated instances of the application for development, testing, and debugging, without affecting the local machine's setup.

Task: Create Dockerfile and docker-compose.yaml

Objective

Create a Dockerfile and docker-compose.yaml for our Java Spring web app to containerize the application and its dependencies, including the database, to streamline the development and deployment process.

Starting Points

Dockerfile: Begin by creating a Dockerfile in the root of the project. This file will specify the base image (e.g., a Java image), the application's dependencies, and how to build and run the application.

docker-compose.yaml file: Create a docker-compose.yaml file to define how our app container interacts with other services, like a database.

Assistance:

  • You can (and definitely should) use the build and run guide to help you kickstart this process. Note: there are definitely some elements of that guide that are out of date. Don't be surprised when something doesn't work and you need to troubleshoot it.
  • You should also investigate the work that has already been done to containerize the built and published project binaries. You'll find many answers to your questions in there: https://github.com/onebusaway/onebusaway-docker

Expected Outcome

  • A Dockerfile that defines the environment and instructions to build and run our Java Spring web app inside a Docker container.
  • A docker-compose.yaml file that orchestrates the app and its database, ensuring they can be spun up together with minimal setup.
  • Documentation in the README.md on how to use Docker to set up, run, and debug the project.

Acceptance Criteria

  • The Dockerfile and docker-compose.yaml should be tested to ensure they work correctly.
  • Documentation must be clear and concise, allowing new developers to get started with the project quickly using Docker.
  • Debugging does not have to work in every IDE imaginable, but you should pick 1 or 2 IDEs that existing OBA server developers use regularly.
  • Ensure that the application, when run through Docker, functions identically to its non-Dockerized counterpart, including database interactions and transit bundle-loading.

This Docker integration will make our development process more efficient, reduce setup time, and eliminate environment-specific issues, leading to a smoother and more consistent development experience for all team members.

@VivekJaiswal18
Copy link

VivekJaiswal18 commented Feb 26, 2024

Hey @aaronbrethorst I am interested in solving this issue. Also is this related to the project idea 'OBA Server -
Containerize development and deployment" for GSoC 2024 or is an independent issue. Thank you

@aaronbrethorst
Copy link
Member Author

@VivekJaiswal18 it is related to the GSoC project idea you mentioned.

@Sunny-2003
Copy link

Sunny-2003 commented Mar 2, 2024

@aaronbrethorst Can I get to know more details about this idea? IMO there is need to add some more context of this idea in GSOC-2024 Ideas List.

@aaronbrethorst aaronbrethorst changed the title Create docker-compose.yml+Dockerfile(s) to make development easier Implement Docker Support for Simplified Development Environment Setup Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants