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

Dockerize ODK CF to streamline development environment setup. #1048

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moise10r
Copy link

@moise10r moise10r commented Nov 3, 2024

What has been done to verify that this works as intended?

To verify that the changes work as intended, I have:

  • I Run the application locally using Docker with docker-compose up --build, ensuring that we still access the app through Ngnix on port 8989 .
  • I also Executed npm run dev to confirm that the development server started without issues.
  • I completed the linting process using npm run lint and confirmed that there are no linting errors.

It encapsulates the development environment within Docker, eliminating the need to install dependencies on the host machine. This setup simplifies onboarding for new developers and ensures a consistent development experience across different setups.

@lognaturel
Copy link
Member

Thank you for this, @moise10r! @sadiqkhoja put together a dev docker-based stack at getodk/central#525 and has been using it. We're hoping to get it merged soon. Would that meet your needs if we link to it clearly from the readme here and for the backend?

@lognaturel
Copy link
Member

I now realize I had forgotten the goals and scope of getodk/central#525. Its focus is setting up all of the services other than Central frontend and backend to lower the bar to local development on those two code bases. It looks like what you want to do is run the frontend in a container while developing on it.

eliminating the need to install dependencies on the host machine.

Did you have an issue with those? The dependencies needed for frontend are minimal, we use volta for version pinning, and it hasn't been a major pain point. We recently had some issues with different versions of nginx but these should now be resolved. If you did run into specific issues getting set up, it would be helpful to know what they were.

@moise10r
Copy link
Author

moise10r commented Nov 6, 2024

Thank you @lognaturel for the feedback, Actually when setting up the Central frontend repo, I was asked to install Nginx on my host machine, and I realized that this approach could lead to each developer potentially running different versions of Nginx. That’s why I was considering running the frontend in a container for development to ensure consistency. For the backend repo, I ran into a version mismatch with Node. After @sadiqkhoja mentioned that Volta is used for version management, I thought it might be more efficient to have a single Docker Compose file for the backend as well. This would automate the database configuration, bringing it up with the necessary steps, and then starting the server with a dependency on the database_service.

@alxndrsn
Copy link
Contributor

alxndrsn commented Nov 7, 2024

this approach could lead to each developer potentially running different versions of Nginx.

An alternative approach to this was discussed at #1035

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

Successfully merging this pull request may close these issues.

3 participants