はじめに RailsアプリをEC2上のdockerで動かしてみます。以下、一台のホストに必要なコンテナsを載せるシングルホスト構成での作業です。ステージング環境のような非production用途を想定しています。 ミドルウェアは以下です。 Ruby 2.2.1 Rails 4.2.1 MySQL 5.6 nginx unicorn サンプルアプリのリポジトリは以下です https://github.com/konpyu/rails-docker-sample コンテナ構成はこんな感じです nginxコンテナ unicornコンテナ mysqlコンテナ データ共有コンテナ ホストの起動と準備 EC2のインスタンスを適当に立てます。今回はCentOS7(ami-89634988)をホストOSとします。