5 Deploy a Service on Gram
Oliver Kennedy edited this page 2021-01-13 22:15:44 -05:00
  1. Get access to Gram via CSE-Consult (Talk to Oliver)
  2. Select an unused port number to use for your service and tell Oliver.
    • This can be be any number 3000 or higher, excluding the following:
      • 3050: Morph
      • 4000: DubStep
      • 5432: Postgresql
      • 8008: Matrix
      • 8080: GitLab
      • 8434: Slack
    • Examples for how to set the port:
      • flask run --port [port number]
  3. Select a domain name for the service: Typically these are [servicename].odin.cse.buffalo.edu. Ask CSE-Consult to CNAME your chosen domain name to gram.cse.buffalo.edu. Make sure to cc Oliver on the email. Wait patiently until CSE-Consult deploys the rule (typically 1-2 business days).
  4. Wait patiently until Oliver installs the nginx rule for your service.
  5. Try running your service from the command line. You should be able to connect to it via https://[servicename].odin.cse.buffalo.edu (yes, that's https, and no, don't include a your chosen port)

Best Practices

  1. Do not bind your service to 0.0.0.0 (this parameter is sometimes called the host when setting up a server). Use either localhost or 127.0.0.1:[port] (this is the default for most standalone server app development tools like flask). Binding to 0.0.0.0 makes it possible to directly access your server from the internet, which is a bad idea for a number of reasons.