Application contract
Every Kyno app needs a root-level Dockerfile. Its final process must follow four rules.
Required
Section titled “Required”- Listen on
0.0.0.0. - Use the
PORTenvironment variable. Kyno currently sets it to8080. - Store persistent files under
/data. - Use
DATABASE_URL=sqlite:////data/app.dbfor the provisioned SQLite database.
The app may access web and API services while it is running. Direct SMTP and cloud metadata access are blocked.
Only the final image from the root Dockerfile runs. Kyno does not start every service in a Docker Compose file or monorepo.
Small Python example
Section titled “Small Python example”FROM python:3.12-slim
WORKDIR /appCOPY app.py .CMD ["python", "app.py"]import osfrom http.server import BaseHTTPRequestHandler, HTTPServer
class Handler(BaseHTTPRequestHandler): def do_GET(self): body = b'{"ok":true}' self.send_response(200) self.send_header("Content-Type", "application/json") self.send_header("Content-Length", str(len(body))) self.end_headers() self.wfile.write(body)
HTTPServer(("0.0.0.0", int(os.environ["PORT"])), Handler).serve_forever()Filesystem
Section titled “Filesystem”The application root filesystem is read-only at runtime. The /data disk is writable and persists across stop, start, and redeploy.
Do not write uploads, generated reports, or SQLite files beside the application source. Write them under /data.
Environment
Section titled “Environment”Kyno injects:
PORTDATABASE_URLSMOL_APP_ID- Variables and secrets supplied during deployment
Variable values and all variable names must be strings. Environment changes take effect after the app restarts.