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

Enable a better local dev experience with vargrant and/or docker/rancher #1255

Open
cpeel opened this issue Jun 28, 2024 · 2 comments
Open
Labels
devex Improving the developer experience

Comments

@cpeel
Copy link
Member

cpeel commented Jun 28, 2024

Doing local development on the DProofreaders codebase is hard. The only prescribed method right now is the development VM which is big and bulky and requires VirtualBox or VMWorkstation / Fusion (the last two are now free for personal use, though).

It would be easier if we could use vagrant or docker containers (via Docker Desktop (paid) or Rancher Desktop (free)). With the addition of the new "JSON" forum backend type (see #953) we no longer need phpBB for the vast majority of feature development too. That means that our bear minimum set of requirements are MySQL and PHP because technically PHP has a built-in web browser (php -S) so we don't even need Apache. This is used in the smoke tests so it works to some degree.

One of the challenges is going to be bootstrapping data into MySQL. The smoketests use a test_tables.sql file which loads some data and a users.json for the forums. A starting point might be to flesh those out to look more like the data in the developer VM and use those both for smoke tests and for local dev. Ideally we'd have some way of programmatically creating some of this without a DB dump but that shouldn't block this effort.

This ticket is a bit open-ended but success would be an initial way of doing development locally without needing the VM.

@cpeel cpeel added the devex Improving the developer experience label Jun 28, 2024
@cpeel
Copy link
Member Author

cpeel commented Jun 28, 2024

As a datapoint, I would lean towards a container-based approach where a docker-compose.yml would bring up a MySQL and PHP/Apache container with local volume mounts pointing to the code and configs and to persist the database. This will still require us figuring out how to install & use composer although there is a docker container for that too.

@chrismiceli
Copy link
Collaborator

I started a branch here a while ago:
https://github.com/chrismiceli/dproofreaders/tree/docker
with this being the important commit: chrismiceli@e932b86
but I didn't get the database populated sufficiently.

I found someone else had a docker repo that used curl to initialize the DB you can see here:
https://github.com/fhs/dproofreaders-docker
particularly in this script
https://github.com/fhs/dproofreaders-docker/blob/master/app/bin/create-admin.bash

I think we' could use the unit test script or API to populate the database more reliably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devex Improving the developer experience
Projects
None yet
Development

No branches or pull requests

2 participants