Skip to main content
If you already have a Docker container that runs an HTTP server, you can move it to fal with minimal changes. There are two common paths:
  • Direct Server Mode: Deploy the container directly with pyproject.toml.
  • Proxy App Mode: Run the server inside a custom image and wrap it with fal.App.
Use Direct Server Mode when your existing server API can be exposed as-is. Use Proxy App Mode when you want a typed Python API, Pydantic validation, fal CDN helpers, or Playground support.

Option 1: Direct Server Mode

Direct Server Mode routes incoming traffic straight to your container’s HTTP port. Your server must bind to 0.0.0.0, listen on the configured exposed_port, and return HTTP 200 from GET /health.
Run it:
Deploy it:
Your server’s API is exposed as-is. If it serves /generate, call:
For queue-backed requests, submit to the same endpoint ID on queue.fal.run:
The Playground is not supported for Docker container apps. Use direct HTTP calls to fal.run or queue-backed calls to queue.fal.run.

Option 2: Proxy App Mode

Use fal.App to wrap your server with custom endpoints. The internal server runs inside the same container, while the public API is defined by Python methods.
Your fal.App controls the API. You can validate inputs, process outputs, upload files to the fal CDN, and use the Playground generated from your Pydantic schemas.

Using a Private Registry

If your Dockerfile pulls from a private base image, configure registry credentials in the image table:
Create the secret before deploying:

Best Practices

Download model weights to persistent storage during startup rather than baking them into the Docker image. This keeps the image smaller and lets weights persist across runner restarts. For Python proxy apps, install fal-specific packages such as fal, pydantic, protobuf, and boto3 at the end of the Dockerfile to avoid dependency conflicts. Direct Docker container apps that do not import fal do not need those packages. Set keep_alive based on startup cost and traffic. A longer value avoids repeated cold starts for heavy models; a shorter value reduces idle billing for fast-starting servers.

Next Steps