Is it possible to pass custom environment variables to the docker container?

Can’t you use the env: section of the container definition for this? That should create an environment variable the Rails app can access.

So like

env:
  CUSTOM_ENV: "value"

Otherwise it looks like pups already pipes in env variables on the host, too.