github.com/wanliu/go-oauth2-server@v0.0.0-20180817021415-f928fa1580df/docker-compose.yml (about) 1 version: "2" 2 3 services: 4 etcd: 5 image: quay.io/coreos/etcd 6 command: etcd --initial-cluster-state new --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://127.0.0.1:2379 7 volumes: 8 - "etcd-data:/default.etcd" 9 ports: 10 - "2379:2379" 11 environment: 12 - ETCDCTL_API=3 13 14 etcd_config: 15 build: 16 context: . 17 dockerfile: ./Dockerfile-etcd-config 18 volumes: 19 - "etcd-data:/default.etcd" 20 environment: 21 - ETCDCTL_API=3 22 - ETCDCTL_ENDPOINTS=etcd:2379 23 depends_on: 24 - etcd 25 links: 26 - etcd 27 28 postgres: 29 image: "postgres" 30 volumes: 31 - "db-data:/var/lib/postgresql/data/pgdata" 32 ports: 33 - "5432:5432" 34 environment: 35 PGDATA: "/var/lib/postgresql/data/pgdata" 36 POSTGRES_USER: "go_oauth2_server" 37 POSTGRES_PASSWORD: "" 38 POSTGRES_DB: "go_oauth2_server" 39 40 app: 41 container_name: go_oauth2_server 42 image: go-oauth2-server:latest 43 depends_on: 44 - etcd_config 45 - postgres 46 links: 47 - etcd 48 - postgres 49 build: 50 context: . 51 dockerfile: ./Dockerfile 52 volumes: 53 - .:/go/src/github.com/wanliu/go-oauth2-server 54 ports: 55 - "8080:8080" 56 environment: 57 ETCD_ENDPOINTS: "http://etcd:2379" 58 command: [runserver] 59 60 app_testdata: 61 container_name: go_oauth2_server_testdata 62 image: go-oauth2-server:latest 63 build: 64 context: . 65 dockerfile: ./Dockerfile 66 environment: 67 ETCD_ENDPOINTS: "http://etcd:2379" 68 depends_on: 69 - etcd_config 70 - postgres 71 links: 72 - etcd 73 - postgres 74 command: ["loaddata", "oauth/fixtures/test_clients.yml"] 75 76 volumes: 77 etcd-data: 78 db-data: