buttonmen-dev / buttonmen

Buttonmen - an online dice game
Other
16 stars 23 forks source link

Add support for building a docker container and starting it locally #2956

Closed cgolubi1 closed 1 month ago

cgolubi1 commented 1 month ago

This is the first step towards helping devs who have dockerd installed locally start test sites.

$ /Users/chaos/games/buttonmen/miniconda3/bin/python ./deploy/docker/deploy_buttonmen_site -l -u
...
About to run docker image locally: ['docker', 'run', '--init', '-d', '-p', '8080:80/tcp', 'local-cgolubi1/local_docker_deploy:5e24231b', '/bin/bash', '/buttonmen/deploy/docker/startup_replay.sh']
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
e4da2bd401c8337e70bb7b43a7a0379cae1eeb5f1d4da65f7cba6cf0552e9877
Site is running locally!  Useful docker commands:
* docker ps: find the ID of the running container
* docker logs <ID>: find startup logs of a container (e.g. to diagnose a container failure)
* docker exec $(docker ps -q) <CMD>: execute a command on the running container
* Use 'docker exec' for remote access
* Access web URL via: http://127.0.0.1:8080
sandbox.buttonweavers.com 127.0.0.1
Not configuring DNS for this target - site is using sandbox FQDN sandbox.buttonweavers.com
Not configuring DNS for this target - dns_update_script_path is not defined in the config file
No post-install configuration for local sites

$ bzcat .../staging.sql.bz2 | grep -v 'SQL SECURITY DEFINER' | docker exec -i $(docker ps -q) sudo mysql_root_cli

After that, i can browse to http://127.0.0.1:8080/ui/index.html and login using a staging account.

cgolubi1 commented 1 month ago

I made this a draft so i can standup a dev site and a replay site just to double-check that i didn't break anything.

After that's done, up to you whether you want to just merge it on the basis of my testing, or have someone try it out first. It's marginally easier for me if you merge it, since then i can start using it locally, but it's not a big deal either way, and if someone wants to try it out ASAP, no reason not to.

I strongly suspect it'll need some iteration to be used by someone who isn't me, just because something always gets missed. But i'm not aware of any specific thing that won't work.

blackshadowshade commented 1 month ago

I think that this would be a great opportunity to bring in someone like @nkmcalli, who can try out what you're doing here.

blackshadowshade commented 1 month ago

Okay, this looks okay to me. Happy to give this a go, and we'll fix any problems we find as they pop up.