jbowens / codenames

Play codenames online
https://www.horsepaste.com
627 stars 207 forks source link

Add deployment instructions #67

Open LukeSchlangen opened 4 years ago

LukeSchlangen commented 4 years ago

@jbowens This is awesome! I've tried playing the last two Friday nights, and the site has been down both times (I'm guessing because of the amount of traffic).

I tried deploying on Heroku and Netlify with no luck. Would you be able to share how you deploy (even if just where you deploy?) and I can attempt to deploy and then document that in the Readme?

Thank you!

jbowens commented 4 years ago

Hi @LukeSchlangen,

Thanks for the note! Yeah, there've been a couple problems in the last couple weeks. Some were bugs that only manifested under the higher load the site has been getting recently, and others were deployment issues under load (like the process's ulimit being too low). I do believe that I have horsepaste on a sufficiently resourced box now and these issues should be resolved.

That said, if you want to deploy it, here are some high-level notes:

When I deploy it horsepaste.com, I also setup a systemd service to restart the process if it crashes for some reason, and I also proxy all requests through nginx which handles TLS termination, gzip compression and sane request timeouts and the like. I run horsepaste on a DigitalOcean droplet running Ubuntu.

zbennett commented 4 years ago

I had issues with Heroku as well. The problem is that Heroku doesn't allow you to expose ports, they just assign you a port and you have to use that. So I made a couple changes and it was up and running. In the Dockerfile change EXPOSE 9091/tcp to CMD gunicorn --bind 0.0.0.0:$PORT wsgi and in main.go change const listenAddr=":9091" to var listenAddr = ":" + string(os.Getenv("PORT")) .

That is all I had to do and it booted up on Heroku.

kaczmarj commented 4 years ago

@LukeSchlangen - I recommend deploying using the included Dockerfile. That file provides a standard method of installing this software, and you won't have to worry about the dependencies that @jbowens went through. Most cloud providers give access to Docker, which is all you would need to run the game.

Instructions are in the README.