I discovered that adding the following to the Dockerfile works:
ARG USER_NAME=foo
USER ${USER_NAME}
This produces the desired output:
2025-02-06T06:30:02Z app[48ed037a547458] bos [info] INFO Preparing to run: python -m main.py as foo
However, I’m wondering if we can achieve the same result without modifying the Dockerfile, perhaps using fly.toml or another approach? I was surprised to find that this configuration option isn’t documented in App configuration (fly.toml) · Fly Docs
I was thinking it would be nice to use user: foo in docker-compose.yml for local development and have something similar in fly.toml for production, while keeping the Dockerfile untouched