diff --git a/README.md b/README.md new file mode 100644 index 00000000..d17e3b79 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# dockerapp + +successfully built in circleCI diff --git a/circle.yml b/circle.yml index 700c79f9..ae4ee9f1 100644 --- a/circle.yml +++ b/circle.yml @@ -6,7 +6,7 @@ machine: dependencies: pre: - - sudo pip install docker-compose + - sudo pip install docker-compose==1.9.0 test: override: @@ -18,7 +18,7 @@ deployment: branch: /.*/ commands: - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD - - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp:$CIRCLE_SHA1 - - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp:latest - - docker push $DOCKER_HUB_USER_ID/dockerapp:$CIRCLE_SHA1 - - docker push $DOCKER_HUB_USER_ID/dockerapp:latest + - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp1:$CIRCLE_SHA1 + - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp1:latest + - docker push $DOCKER_HUB_USER_ID/dockerapp1:$CIRCLE_SHA1 + - docker push $DOCKER_HUB_USER_ID/dockerapp1:latest diff --git a/common.yml b/common.yml new file mode 100644 index 00000000..99579bb3 --- /dev/null +++ b/common.yml @@ -0,0 +1,7 @@ +version: '2' +services: + dockerapp: + ports: + - "5000:5000" + redis: + image: redis:3.2.0 diff --git a/docker-compose.yml b/docker-compose.yml index 2c57eda6..8b6b1188 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,12 @@ version: '2' services: dockerapp: + extends: + file: common.yml + service: dockerapp build: . - ports: - - "5000:5000" redis: - image: redis:3.2.0 + extends: + file: common.yml + service: redis diff --git a/prod.yml b/prod.yml index b0096ff1..7e54684e 100644 --- a/prod.yml +++ b/prod.yml @@ -1,9 +1,24 @@ version: '2' services: dockerapp: + extends: + file: common.yml + service: dockerapp image: jleetutorial/dockerapp - ports: - - "5000:5000" + environment: + - constraint:node==master + depends_on: + - redis + networks: + - mynet redis: - image: redis:3.2.0 + extends: + file: common.yml + service: redis + networks: + - mynet + +networks: + mynet: + driver: overlay