Skip to content

Instantly share code, notes, and snippets.

@anarcher

anarcher/fig.yml Secret

Last active August 29, 2015 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anarcher/a6727f8948a0452239a3 to your computer and use it in GitHub Desktop.
Save anarcher/a6727f8948a0452239a3 to your computer and use it in GitHub Desktop.
UsingFig
redis:
image: redis
docker_host: tcp://127.0.0.1:5555
redislocal:
image: redis

Fig란?

http://fig.sh

Fast, isolated development environments using Docker.

  • 기본적으로 한 호스트에서 있는 여러 컨테이너들을 yaml기반의 설정파일로 관리하는 도구.
  • 특히 개발환경에서 여러 레이어(DB,APIServer,CacheServer 등등)를 하나의 호스트에서 사용할때 편리하다
  • 현재 (docker 1.2) container linking은 한 호스트에서만 가능하다.

Fig 사용하기

  • fig.yml

      web:
        build: .
        command: python app.py
        links:
         - db
        ports:
         - "8000:8000"
      db:
        image: postgres
    

    img

      (개인적으로는 여러 컨테이너의 로그를 한번에 볼수 있어서 개발할때 편하다 ㅎㅎ)
    
  • fig commands : http://www.fig.sh/cli.html

  • fig.yml : http://www.fig.sh/yml.html

    Note: Mapping local volumes is currently unsupported on boot2docker. We recommend you use docker-osx if want to map local volumes. (https://github.com/noplay/docker-osx)

Production에서 사용하기

  • DOCKER_HOST=tcp://[ip]:[port] ; fig [command]
  • docker/compose#527 : 각 서비스마다 다른 docker_host을 설정해서 여러 호스트에 띠울수 있도록 한 패치.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment