| 1 |
local nginx = import 'nginx.libsonnet'; |
| 2 |
local uwsgi_flask = import 'uwsgi_flask.libsonnet'; |
| 3 |
|
| 4 |
{ |
| 5 |
/** A mixin on top of an HttpService with Debian instances that adds nginx, uwsgi, and flask. */ |
| 6 |
DebianFlaskHttpService: { |
| 7 |
local service = self, |
| 8 |
uwsgiModuleContent:: ||| |
| 9 |
import flask |
| 10 |
app = flask.Flask(__name__) |
| 11 |
@app.route('/') |
| 12 |
def hello_world(): |
| 13 |
return 'No content is configured for this web service.' |
| 14 |
|||, |
| 15 |
Instance+: nginx.DebianNginxMixin + uwsgi_flask.DebianUwsgiFlask + uwsgi_flask.NginxUwsgiGlue { |
| 16 |
httpPort:: service.httpPort, |
| 17 |
httpsPort:: service.httpsPort, |
| 18 |
sslCertificate:: service.sslCertificate, |
| 19 |
sslCertificateKey:: service.sslCertificateKey, |
| 20 |
uwsgiModuleContent: service.uwsgiModuleContent, |
| 21 |
}, |
| 22 |
}, |
| 23 |
} |