フロントとバックエンドを同一コンテナで済ませるパターンと, 1 プロセス 1 コンテナの原則に従い個別コンテナでやるパターンです. 他にも, 共有ストレージ専用の busybox を利用するパターン などがあるようです. 今回の要件 フロントエンドは Nginx, バックエンドは Rails5 (Puma) Nginx-Puma 間は socket 通信 Rails の静的コンテンツ (public/ 配下) は Nginx が処理する パターンA: Nginx と Rails が同一コンテナ 全てのコードはこちらにあります. https://github.com/na-o-ys/rails_docker_sample/tree/single-container 全体図 $ rails new 直後のディレクトリに Dockerfile などを配置したもの. 一つの Dockerfile