Environment-dependent commands in Dockerfile?

I’m totally new to Docker and having trouble understanding how to run different commands depending on the environment.

I’m Docker-izing a small Ruby app, and in development I would normally run bundle install before booting the app, but in production I would run something like bundle install --without development --deployment. Also even just running the app is done differently depending on the environment. In development I’d run bundle exec middleman but in production I’d run something like bundle exec thin start.

What’s the proper way to go about doing something like this?