Sfoglia il codice sorgente

Rename services to remove "app"

Ben Firshman 9 anni fa
parent
commit
09279e12a8

+ 6 - 6
docker-compose.yml

@@ -1,11 +1,11 @@
 version: "2"
 
 services:
-  voting-app:
-    build: ./voting-app
+  vote:
+    build: ./vote
     command: python app.py
     volumes:
-     - ./voting-app:/app
+     - ./vote:/app
     ports:
       - "5000:80"
 
@@ -19,11 +19,11 @@ services:
   db:
     image: postgres:9.4
 
-  result-app:
-    build: ./result-app
+  result:
+    build: ./result
     command: nodemon --debug server.js
     volumes:
-      - ./result-app:/app
+      - ./result:/app
     ports:
       - "5001:80"
       - "5858:5858"

+ 5 - 5
dockercloud.yml

@@ -4,9 +4,9 @@ db:
 redis:
   image: 'redis:latest'
   restart: always
-result-app:
+result:
   autoredeploy: true
-  image: 'instavote/result-app:latest'
+  image: 'instavote/result:latest'
   ports:
     - '80:80'
   restart: always
@@ -14,15 +14,15 @@ lb:
   autoredeploy: true
   image: 'dockercloud/haproxy:latest'
   links:
-    - voting-app
+    - vote
   ports:
     - "80:80"
   roles:
     - global
   restart: always
-voting-app:
+vote:
   autoredeploy: true
-  image: 'instavote/voting-app:latest'
+  image: 'instavote/vote:latest'
   restart: always
   target_num_containers: 5
 

+ 0 - 15
result-app/tests/tests.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-while ! timeout 1 bash -c "echo > /dev/tcp/voting-app/80"; do sleep 1; done
-curl -sS -X POST --data "vote=a" http://voting-app > /dev/null
-curl -sS -X POST --data "vote=b" http://voting-app > /dev/null
-sleep 10
-if phantomjs render.js http://result-app | grep -q '2 votes'; then
-  echo -e "\e[42m------------"
-  echo -e "\e[92mTests passed"
-  echo -e "\e[42m------------"
-  exit 0
-fi
-  echo -e "\e[41m------------"
-  echo -e "\e[91mTests failed"
-  echo -e "\e[41m------------"
-  exit 1

+ 0 - 0
result-app/.vscode/launch.json → result/.vscode/launch.json


+ 0 - 0
result-app/Dockerfile → result/Dockerfile


+ 5 - 5
result-app/docker-compose.test.yml → result/docker-compose.test.yml

@@ -5,14 +5,14 @@ services:
   sut:
     build: ./tests/
     depends_on:
-      - voting-app
-      - result-app
+      - vote
+      - result
       - worker
     networks:
       - front-tier
 
-  voting-app:
-    build: ../voting-app/
+  vote:
+    build: ../vote/
     ports: ["80"]
     depends_on:
       - redis
@@ -21,7 +21,7 @@ services:
       - front-tier
       - back-tier
 
-  result-app:
+  result:
     build: .
     ports: ["80"]
     depends_on:

+ 1 - 1
result-app/package.json → result/package.json

@@ -1,5 +1,5 @@
 {
-  "name": "result-app",
+  "name": "result",
   "version": "1.0.0",
   "description": "",
   "main": "server.js",

+ 0 - 0
result-app/server.js → result/server.js


+ 0 - 0
result-app/tests/Dockerfile → result/tests/Dockerfile


+ 0 - 0
result-app/tests/render.js → result/tests/render.js


+ 15 - 0
result/tests/tests.sh

@@ -0,0 +1,15 @@
+#!/bin/sh
+while ! timeout 1 bash -c "echo > /dev/tcp/vote/80"; do sleep 1; done
+curl -sS -X POST --data "vote=a" http://vote > /dev/null
+curl -sS -X POST --data "vote=b" http://vote > /dev/null
+sleep 10
+if phantomjs render.js http://result | grep -q '2 votes'; then
+  echo -e "\e[42m------------"
+  echo -e "\e[92mTests passed"
+  echo -e "\e[42m------------"
+  exit 0
+fi
+  echo -e "\e[41m------------"
+  echo -e "\e[91mTests failed"
+  echo -e "\e[41m------------"
+  exit 1

+ 0 - 0
result-app/views/app.js → result/views/app.js


+ 0 - 0
result-app/views/index.html → result/views/index.html


+ 0 - 0
result-app/views/socket.io.js → result/views/socket.io.js


+ 0 - 0
result-app/views/stylesheets/style.css → result/views/stylesheets/style.css


+ 0 - 0
voting-app/Dockerfile → vote/Dockerfile


+ 0 - 0
voting-app/app.py → vote/app.py


+ 0 - 0
voting-app/requirements.txt → vote/requirements.txt


+ 0 - 0
voting-app/static/stylesheets/style.css → vote/static/stylesheets/style.css


+ 0 - 0
voting-app/templates/index.html → vote/templates/index.html