How do I open the Rails console in Discourse Docker in production mode?

I added the bellow in app. yml, but it fails, how can I run rails c with out interacting I need to run it once. (I am using ansible to automate installation)

run:
  - exec: echo "Beginning of custom commands"
  # If you want to set the 'From' email address for your first registration, uncomment and change:
  # After getting the first signup email, re-comment the line. It only needs to run once.
  - exec:   rails r "u = User.create!(username: '{{ discourse_developer_username }}', email: '{{ discourse_developer_emails }}', password: '{{ discourse_developer_password }}', admin: true)"