geerlingguy / beast-challenge

A control system for MrBeast's 1-100 challenge
GNU General Public License v3.0
26 stars 1 forks source link

Build production deployment for leader-app and front end #8

Closed geerlingguy closed 1 year ago

geerlingguy commented 1 year ago

Deployment Plan

Original Notes

I've been doing all my testing and development via flask run, but as it says right in its own output:

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

So this issue is to track setting up a Docker-ized environment in which to actually run the app, with a separate Docker volume so we can get at the data. If we're booting Linux on the NUC server, we could use a shared directory so we can get at the .sqlite database more easily from other computers on the network.

geerlingguy commented 1 year ago

Maybe use this setup: https://github.com/docker/awesome-compose/tree/master/flask

Or if that is not performing as well, run https://github.com/docker/awesome-compose/tree/master/nginx-wsgi-flask with Nginx as a proxy in front (though we want real-time... so ideally we can run it direct, even sacrificing a little performance. Though it would be nice to let Nginx cache all the static files!

geerlingguy commented 1 year ago

Also need to run React front-end, so maybe a docker-compose.yml file with a Dockerfile or two to build out each container, then have them all up and running?

Worst case just install junk flat on the server and run it YOLO style. Not the end of the world since that's literally all this server will be doing!

geerlingguy commented 1 year ago

Gotta work on this before Monday night.

geerlingguy commented 1 year ago

For the database, I would like to do two things:

  1. Store it in like ../leader.sqlite and have a volume mount in the docker-compose.yml file.
  2. Maybe add a web UI for it? Or Firefox plugin for viewing the database on the computer itself?

Also add a CI job in Actions that just builds the app in Docker and checks that certain URLs are working.