13ft icon indicating copy to clipboard operation
13ft copied to clipboard

Use production-ready Gunicorn WSGI server instead of Flask dev server

Open dablenparty opened this issue 3 months ago • 0 comments

Closes #40

📑 Description

Replaces the Flask development server with a production-ready Gunicorn server. I configured the Gunicorn port to be the same 5000 as before, but it is also configurable via the PORT environment variable like PR #18. I also updated the Dockerfile to run the Gunicorn server as a rootless user per Flask docs.

  • [x] Production WSGI server
  • [ ] Reverse Proxy Config
    • The ProxyFix class config is dependent on the proxy setup of the end-user, so I need to figure out a way to easily configure this with sane defaults. Maybe it should just be its own PR?

✅ Checks

  • [X] My code requires changes to the documentation
    • Just a slight change to README, already done
  • [X] I have updated the documentation as required
  • [X] All the tests have passed if any

ℹ Additional Information

Three more changes that aren't necessary, but helpful imo:

  • I added a compose file for development, docker-compose.dev.yaml. Use it like so: docker compose -f docker-compose.dev.yaml <command>
  • I updated the Dockerfile to cache the pip dependencies so that they don't have to be re-downloaded every single time the image is built.
  • I accidentally ran a markdown formatter on the README.

If either of these are an issue, I can easily undo them.

dablenparty avatar Oct 01 '25 18:10 dablenparty