LoginSignup
4
4

More than 5 years have passed since last update.

Docker Composeを使ってNginxコンテナとGoFCGIコンテナ立ち上げてみた。

Last updated at Posted at 2015-05-30

事前に必要な物

docker

Macの場合はboot2docker

Dockerが実行可能なcoreosなどでもOK(https://github.com/coreos/coreos-vagrant)

docker-compose

複数のコンテナからなるアプリケーションを
YAMLファイル一つで定義して、簡単なコマンドでアプリケーションの起動や管理ができるツールです。

サンプルを触ってみる

リポジトリをclone

$ git clone https://github.com/shinofara/golang-web-application.git
$ golang-web-application

Containerを立ち上げる

build an image for your code, and start everything up

ビルドして、そして全部立ち上げます。

$ docker-compose up -d
Recreating demo_go_1...
Recreating demo_nginx_1...

確認してみましょう

$ curl -l http://<docker host serverのIP>:18888
Hello World !

作成したコード一式
https://github.com/shinofara/golang-web-application

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4