Developing apps
What your app has to do to run well on Teflon, and what the platform does around it.
The contract
Your container must listen for plain HTTP on the port you gave teflon deploy --port, on all interfaces.
That port is also injected as the PORT environment variable, so reading $PORT and passing --port the same number both work.
Setting PORT yourself with --set-env does nothing: the platform's value wins.
Do not serve TLS from your app.
Users reach https://my-app.tf.int.tubi.io, TLS terminates at the edge, and your container receives plain HTTP.
If your framework builds absolute URLs from the request, trust X-Forwarded-Proto rather than the wire scheme, or you will emit http:// links.
Images are built for and run on amd64 nodes. Buildpack builds handle this for you; a Dockerfile that pulls an arm-only base image will not run.
Dockerfile or buildpacks
You do not have to choose up front.
With no Dockerfile in the source directory, Cloud Native Buildpacks detect your language and build an image with sensible defaults - for a typical Node, Python, or Go app this just works.
A Dockerfile at the source root switches to the Dockerfile builder automatically, and --builder overrides the detection either way.
Reach for a Dockerfile when you need control the buildpack does not give you: a system package, a multi-stage build, a specific base image, an unusual start command. Start with buildpacks otherwise; it is one less file to maintain. The mechanics of both are covered in Deploying.
Common shapes
A static site
A single page or a folder of static HTML needs nothing but nginx. The unprivileged image listens on 8080, so that is the port to deploy with:
FROM nginxinc/nginx-unprivileged:alpine
COPY index.html /usr/share/nginx/html/
RUN chmod -R a+r /usr/share/nginx/html
The chmod matters: nginx runs as an unprivileged user, and a source file with mode 600 copies in unreadable and serves a 403.
Next.js
Next.js 16 does not build with buildpacks.
The Node buildpack symlinks node_modules out of the project, and Turbopack refuses that layout: Symlink [project]/node_modules is invalid, it points out of the filesystem root.
teflon deploy warns when it sees next 16 or newer in package.json without a Dockerfile; use one, with the standalone output so the runtime image carries only what the server needs.
// next.config.js
module.exports = ;
FROM node:lts-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:lts-alpine
WORKDIR /app
ENV NODE_ENV=production HOSTNAME=0.0.0.0
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
COPY --from=build /app/public ./public
CMD ["node", "server.js"]
The standalone server reads PORT and HOSTNAME, so teflon deploy my-app --port 3000 needs nothing else.
Keep the local build output and dependencies out of the upload with a .dockerignore:
node_modules
.next
.claude
One more Node pitfall, for Vite and anything else on rollup: a package-lock.json written on macOS records only the darwin native binary, so npm ci on the amd64 build node fails with Cannot find module @rollup/rollup-linux-x64-gnu.
This is an npm bug with optional dependencies; the fix is npm install --no-optional locally to rewrite the lockfile, or RUN npm install instead of npm ci in the Dockerfile.
A frontend plus an API
One app is one port, so a frontend and its API cannot be two containers in one app. Either have the API server also serve the built static assets, or put nginx in front of both inside the image. Two separate apps cannot talk to each other over the internal network either; see Reaching out from your app below.
The simplest shape is a multi-stage Dockerfile: build the frontend, then copy its output into the API image and let the API serve it as static files.
FROM node:22-alpine AS web
WORKDIR /web
COPY web/ .
RUN npm ci && npm run build
FROM node:22-alpine
WORKDIR /app
COPY api/ .
RUN npm ci --omit=dev
COPY --from=web /web/dist ./public
CMD ["node", "server.js"]
The API serves ./public at / (express.static, or your framework's equivalent) and its routes under /api, all on the one $PORT.
If you would rather keep nginx for the static files, it goes in front as the single listener and proxies /api to the API process on a second port inside the container; that needs a process supervisor to run both, so reach for it only when the API cannot serve files itself.
A Python app
Two things trip up Python deploys that work fine on a laptop.
Python block-buffers stdout when it is not a terminal, so print() output sits in the buffer and teflon logs shows nothing until the buffer fills or the process exits.
Deploy with --set-env PYTHONUNBUFFERED=1, or start the app with python -u; the buildpack does not set this for you.
The Python buildpack's default start command is the Python REPL, not your app.
Without a Dockerfile you need a Procfile at the source root naming the web process:
web: gunicorn app:app
gunicorn (or uvicorn, flask run, ...) must be in your dependencies and must bind 0.0.0.0:$PORT.
Batch and cron-style work
Every app must listen on --port, including one whose real job is a nightly batch.
Wrap the work in a thin HTTP server with a /health route and a POST /run route that kicks the job off, and trigger it from outside with an API token:
Have /run return immediately and do the work in the background; the gateway answers 504 for any response that takes longer than 60 seconds (see Timeouts and request limits below).
Who is the user
Every request that reaches your app has already been through SSO, or carries a webhook token from a vendor you registered (see Webhooks).
There is no anonymous traffic: an unauthenticated browser is redirected to login, an unauthenticated API call gets a 401, and neither reaches your container.
So a bare curl against any path of your app, /health included, is a 401 from the gateway, not a sign the app is down; probe it with an API token as shown in Getting started.
The proxy tells you who the user is with two headers:
| Header | Value |
|---|---|
X-Auth-Request-Email | The user's email address |
X-Auth-Request-User | The user's Teflon id, a uuid |
You can trust these. The proxy strips any inbound copies before setting its own, so a client cannot spoof them, and traffic cannot reach your pod except through the proxy. This means most apps need no auth code at all: read the email header and you have a logged-in user.
Requests authenticated with an API token carry the same two headers, describing the person who minted the token.
The proxy also removes the Authorization header and Teflon's own session cookie before forwarding, so your app never sees Teflon credentials.
Your app's own cookies pass through untouched.
Two paths on your host are reserved for the login flow and never reach your app: /.teflon/auth/callback and /.teflon/auth/logout.
Restricting who gets in
SSO says the user is a real employee; it does not say they should see your app. So a new app is private: its allow list is enforced from the start, and until you add someone only you, the owner, get in. Add your teammates:
Only listed emails (and always you, the owner) get through; everyone else gets a 403 page naming their denied address and the app's owner, so they know who to ask.
disable opens the app to everyone-with-SSO; enable makes it private again, with the saved list.
Editing the list never toggles enforcement - only enable and disable do.
The same controls live in the console on the app's detail page, in the Privacy card on the Access tab. Allowed users arrive with the same identity headers as always.
An enforced allow list also keeps the app off the console's Tubiverse Apps - members find it under Shared with you on their My Apps page instead - and stops everyone else minting an API token for it; a public app can be found, visited, and scripted by any logged-in user.
Sharing control: admins
The allow list shares access; admins share control. An admin can deploy the app and manage its env vars and allow list, but cannot delete it, bind secrets, or change who the admins are.
Any admin can still read every secret bound to the app. Admins can deploy code and read logs, and deployed code receives bound secrets as environment variables. Only make someone an admin if you would trust them with those values.
All three are owner-only.
If the app has bound secrets, teflon app admin add names them and asks you to confirm; pass --yes to skip the question in scripts.
The console's Admins card, on the Access tab, does the same with a checkbox you tick before the Add button works.
Adding an admin also makes them an allow-list member, so an admin can always reach the app; someone already on the allow list is upgraded in place.
Removing an admin demotes them back to a plain allow-list member - they keep access to the app until you also teflon app allowlist remove them.
Apps you administer show up in your own teflon app list and on the console's My Apps page with an admin badge, and the app's Access tab has an Admins card; only the owner sees its add and remove controls.
When the owner hands the app to someone else with teflon app transfer, they become an admin themselves unless they chose to leave.
The owner never shows in the admin list: ownership is not a role, so the person who just received the app is not an admin of it.
Webhooks
A vendor such as DocuSign Connect cannot log in through a browser, and an API token dies when its owner leaves or it expires. A webhook is the credential for a third party instead: one sender allowed to call one exact path on your app, with an OAuth client id and secret that belong to the app.
Webhooks covers the whole flow: how the token exchange works, what the proxy checks, DocuSign setup, the X-Teflon-Webhook header your app receives, and rotating or deleting a webhook.
Timeouts and request limits
The proxy applies fixed timeouts to every request to your app:
| Timeout | Value |
|---|---|
| Connect | 2 seconds |
| Read | 60 seconds |
| Write | 60 seconds |
| Idle connection | 90 seconds |
The read timeout is per read, not per request: a response that streams a byte at least every 60 seconds keeps going, but a handler that goes silent for 60 seconds is cut off. In practice, a request that takes longer than 60 seconds to send a response gets a 504 from the gateway, and your handler's eventual answer is thrown away. Move long work to a background job: return a job id immediately and have the client poll for the result.
Server-sent events work through the proxy, subject to that same keep-something-flowing rule.
WebSockets are not supported.
Responses are gzip-compressed at the proxy, so your app does not need to compress its own output.
Event streams (text/event-stream) are never compressed, so each event reaches the browser as soon as your app sends it.
The proxy sets X-Forwarded-For to the one client address it can vouch for: the address the load balancer appended, or the connecting socket's address when there is no load balancer in front.
It is always a single address; any X-Forwarded-For, Forwarded, X-Real-IP, or similar header the client sent is dropped, so the value cannot be spoofed and is safe for rate limiting or audit logs.
X-Forwarded-Host and X-Forwarded-Proto (always https) are set as well.
The box your app runs in
Each app runs as a single instance - one pod, no autoscaling - with these resources:
| Resource | Guaranteed | Limit |
|---|---|---|
| CPU | 0.1 cores | 2 cores |
| Memory | 256 MiB | 2 GiB |
| Ephemeral disk | 512 MiB | 5 GiB |
Ephemeral disk is the container's writable layer. A persistent volume is separate and not counted against it: you choose its size at deploy time, from 1 GiB to 10 GiB.
An app that exceeds the memory limit is killed and restarted, and the app's status will say OOMKilled so you know that is what happened.
Crashes restart automatically; a crash loop shows up as CrashLoopBackOff in teflon app get and in the console.
The filesystem is writable but ephemeral: every deploy and every restart starts from a clean image.
Anything that must survive belongs in a database, a persistent volume, or an external store.
Create a database with teflon db create my-app --engine postgres; Postgres, MySQL, and Redis are on offer, and an app can have one of each (Postgres and Redis together, for example).
Attach a volume with teflon deploy --volume-size 5GiB --volume-mount /data and remove it with teflon volume remove.
A database's disk is not a volume: teflon volume never touches it, and only teflon db does.
A database is the better fit for structured data, because it is backed up daily and a volume is not.
See Maintenance for the trade-offs a volume brings.
On shutdown your process gets SIGTERM and then 10 seconds before it is killed.
Handling SIGTERM promptly makes your deploys faster and cleaner, but a plain kill after 10 seconds is the worst case.
A deploy normally rolls the new pod in before the old one goes; an app with a volume instead stops the old pod first, so expect a brief gap there.
There are no health probes: traffic can arrive as soon as your process starts, so bind the port early and finish slow warmup in the background.
Reaching out from your app
Your app can reach the public internet - external APIs, package registries, webhooks all work. It cannot reach anything inside the network: other Teflon apps, the cluster, internal services, and cloud metadata endpoints are all blocked. If two of your apps need to talk, they do it the same way a user does - over the public hostname, with an API token minted for the target app.
Outbound network
Everything your app sends out - and everything your build fetches - leaves through two NAT gateways with fixed addresses:
18.225.241.1673.143.125.186
An internal Tubi service that sits behind an nginx IP allowlist sees your app as one of those two addresses, so it needs both added to its allowlist before your app (or its build) can reach it.
Build-time fetches (a private package registry, an internal artifact host) egress the same way, so allowlisting the runtime is not enough if the build also needs in.
The dfw app in adRise/kustomization (apps/base/dfw/resources/policies-teflon.yaml) is the precedent: an nginx Policy with accessControl.allow listing the two addresses.
The current set is always terraform output nat_egress_ips in the teflon repo's infra/; it only changes if the network is rebuilt.
Configuration
Configuration reaches your app as environment variables: plain values with --set-env, sensitive ones as secret bindings.
Both are covered in Secrets and environment.
Changing either rolls the app so the new values take effect - there is no in-place reload to build.