beam deploy.
Deploy a Dockerfile
Create a directory with thisDockerfile:
Dockerfile
--dockerfile when the file is named Dockerfile in your current directory.
Services are public by default. Use
Service(authorized=True) to require a Beam token, or add authentication in your app.Ports and Commands
Bind your server to0.0.0.0 or ::. Repeat --port to expose multiple ports. Without it, Beam uses the Dockerfile’s EXPOSE ports or defaults to 8000. The first port sets PORT unless you override it.
The image’s ENTRYPOINT and CMD run by default. To override them:
--command passes literal arguments. For shell syntax, use --command 'sh -c "your command"'.
Background Workers
Use--no-ports for a background worker:
--replicas 1 to keep one running.
Configuration and Storage
.beamignore to exclude local files from upload.
Scaling and Idle Time
Services default to 0–1 replicas and shut down after 600 idle seconds. To change this:Python Service API
You can also deploy from Python:app.py
Service.from_registry("nginx:alpine", port=80) for a registry image. A Python command string runs through a shell; a list passes literal arguments.