From 13f7f84ed7823d4a3841ef2bea4c53c0a25ba5ec Mon Sep 17 00:00:00 2001 From: Jack Murdock Date: Wed, 16 Jan 2019 09:06:31 -0800 Subject: [PATCH] Adding docker-compose (#2) * fix .travis.yml * adding docker-compose * renamed .docker to deploy/docker-compose --- .travis.yml | 3 - deploy/docker-compose/README.md | 9 +++ deploy/docker-compose/docFiles/gungnir.yaml | 36 ++++++++++++ deploy/docker-compose/docFiles/svalinn.yaml | 46 +++++++++++++++ deploy/docker-compose/docker-compose.yml | 65 +++++++++++++++++++++ 5 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 deploy/docker-compose/README.md create mode 100644 deploy/docker-compose/docFiles/gungnir.yaml create mode 100644 deploy/docker-compose/docFiles/svalinn.yaml create mode 100644 deploy/docker-compose/docker-compose.yml diff --git a/.travis.yml b/.travis.yml index cd8f836..c809d1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,3 @@ -go_import_path: github.com/comcast/viper - - language: go go: diff --git a/deploy/docker-compose/README.md b/deploy/docker-compose/README.md new file mode 100644 index 0000000..505cb74 --- /dev/null +++ b/deploy/docker-compose/README.md @@ -0,0 +1,9 @@ +# Docker Compose + +```bash +# build the images svalinn or gungnir +# or pull kcajmagic/gungnir-dev:latest and kcajmagic/svalinn-dev:latest +# and retag it + +docker-compose up -d +``` diff --git a/deploy/docker-compose/docFiles/gungnir.yaml b/deploy/docker-compose/docFiles/gungnir.yaml new file mode 100644 index 0000000..37ccd06 --- /dev/null +++ b/deploy/docker-compose/docFiles/gungnir.yaml @@ -0,0 +1,36 @@ +--- + primary: + address: ":7000" + health: + address: ":7001" + options: + - "PayloadsOverZero" + - "PayloadsOverHundred" + - "PayloadsOverThousand" + - "PayloadsOverTenThousand" + readTimeout: "15s" + idleTimeout: "15s" + pprof: + address: ":7002" + readTimeout: "15s" + idleTimeout: "15s" + metric: + address: ":7003" + metricsOptions: + namespace: "webpa" + subsystem: "tr1d1um" + readTimeout: "15s" + idleTimeout: "15s" + log: + file: "stdout" + level: "INFO" + json: true + + authHeader: ["YXV0aEhlYWRlcg=="] + + db: + server: "db:11210" + bucket: "devices" + username: "Administrator" + password: "somepassword" + numRetries: 4 diff --git a/deploy/docker-compose/docFiles/svalinn.yaml b/deploy/docker-compose/docFiles/svalinn.yaml new file mode 100644 index 0000000..e63ec9c --- /dev/null +++ b/deploy/docker-compose/docFiles/svalinn.yaml @@ -0,0 +1,46 @@ +--- +primary: + address: ":7100" +health: + address: ":7101" + options: + - "PayloadsOverZero" + - "PayloadsOverHundred" + - "PayloadsOverThousand" + - "PayloadsOverTenThousand" + readTimeout: "15s" + idleTimeout: "15s" +pprof: + address: ":7102" + readTimeout: "15s" + idleTimeout: "15s" +metric: + address: ":7103" + metricsOptions: + namespace: "webpa" + subsystem: "tr1d1um" + readTimeout: "15s" + idleTimeout: "15s" +log: + file: "stdout" + level: "INFO" + json: true + +config: + endpoint: "/device-status" + queueSize: 3000 + db: + server: "db:11210" + username: "Administrator" + password: "somepassword" + bucket: "devices" + numRetries: 4 + +authHeader: ["YXV0aEhlYWRlcg=="] + +webhook: + secret: "Basic YXV0aEhlYWRlcg==" + registrationInterval: "4m" + url: "http://host.docker.internal:8181/api/v1/device-status" + timeout: "1m" + registrationURL: "http://127.0.0.1:6000/hook" diff --git a/deploy/docker-compose/docker-compose.yml b/deploy/docker-compose/docker-compose.yml new file mode 100644 index 0000000..d45dd3d --- /dev/null +++ b/deploy/docker-compose/docker-compose.yml @@ -0,0 +1,65 @@ +version: '3.4' + +services: + gungnir: + image: gungnir:local + container_name: gungnir + hostname: gungnir + restart: on-failure + ports: + - 7000:7000 + - 7001:7001 + - 7002:7002 + - 7003:7003 + volumes: + - ./docFiles/gungnir.yaml:/etc/gungnir/gungnir.yaml + networks: + - back-tier + depends_on: + - db + + svalinn: + image: svalinn:local + container_name: svalinn + hostname: svalinn + restart: on-failure + ports: + - 7100:7100 + - 7101:7101 + - 7102:7102 + - 7103:7103 + volumes: + - ./docFiles/svalinn.yaml:/etc/svalinn/svalinn.yaml + networks: + - back-tier + depends_on: + - db + + db: + image: bentonam/couchbase-docker:community + container_name: db + hostname: db + ports: + - 8091:8091 + - 8092:8092 + - 8093:8093 + - 8094:8094 + - 11210:11210 + environment: + CLUSTER_USERNAME: Administrator + CLUSTER_PASSWORD: somepassword + CLUSTER_NAME: My Couchbase Cluster + SERVICES: data,index,query,fts + CLUSTER_RAMSIZE: 500 + BUCKET: devices + BUCKET_RAMSIZE: 300 + NODE_INIT_INDEX_PATH: /opt/couchbase/var/lib/couchbase/indexes + RBAC_USERNAME: devices + RBAC_PASSWORD: password123 + RBAC_PASSWORD: bucket_full_access[devices] + ENABLE_FLUSH: 1 + networks: + - back-tier + +networks: + back-tier: