Open LukeSchlangen opened 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:
$GOPATH/src/github.com/jbowens/codenames
, you go install github.com/jbowens/codenames/cmd/codenames
to build the binary and have it deposited into $GOPATH/bin
.frontend/build.sh
will build the frontend, creating a frontend/dist
directory with the resulting assets.frontend/dist
directory, the codenames binary also expects an assets/
directory to be in the current working directory, containing the contents of this repo's assets/
directory. The easiest thing to do is just run the codenames binary w/ the current working directory set to the github repo's directory where you've already built the frontend.PEBBLE_DIR
that can be set to tell the codenames process where on the filesystem it should write data. If you omit the environment variable, it'll default to (and create) a db
directory within the current working directory.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.
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.
@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.
@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!