Python
Last updated
Python is fully supported by the zip flow — upload your project and the agent works out the entry point and dependencies.
What to include
- Your
.pysources requirements.txtalongside them, if you have one. Without a dependency manifest the agent has to infer your dependencies from your imports, which works but is less reliable than telling it.- Config files your app reads at runtime
Leave out venv / .venv, __pycache__, .env, and any local database file.
Make the entry point clear
One obvious starting file. If your project has several plausible entry points, the agent has to guess — a conventional name and a single requirements.txt removes the ambiguity.
Two settings worth adding immediately
PYTHONUNBUFFERED=1 as an environment variable. Python buffers stdout when it isn't attached to a terminal, so without this your app can run for a long time and log nothing — and lose the buffer entirely if it crashes. This is the single most common "my logs are empty" cause.
A volume and a configurable path if you store anything:
DB_PATH = os.environ.get("DB_PATH", "./app.db") # set DB_PATH=/data/app.db on the app
A SQLite file written next to your code is discarded on the next deploy, silently.
Web apps
Use a production server and bind all interfaces:
gunicorn --bind 0.0.0.0:8000 app:app
uvicorn app:app --host 0.0.0.0 --port 8000
flask run and manage.py runserver are development servers and default to localhost, which makes them unreachable no matter what port you bind. Then add an HTTPS port binding for that port.
Workers and bots
If your app has no inbound traffic — a Discord or Telegram bot, a poller, a queue consumer — don't bind a port at all. There's nothing to route and nothing to keep awake; your process simply runs.
For a script that currently runs once and exits, wrap the work in a loop with a sleep so it becomes a service rather than a job.
Timezones
Containers run on UTC unless you say otherwise. If your app does anything time-of-day dependent, set a TZ environment variable, and prefer storing instants in UTC with named zones (Europe/Kyiv) rather than fixed offsets.
Dependencies that need system packages
Some wheels need OS libraries present. The agent can install them as part of the build when it detects the need, but if a package consistently fails to build, that's the point to switch to a Dockerfile where you control the apt-get line explicitly.