Merge pull request #21 from bfirsh/rename-services
Rename services to remove "app"
This commit is contained in:
commit
ade2b40403
@ -1,10 +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"
|
||||
|
||||
@ -18,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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
@ -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,5 +1,5 @@
|
||||
{
|
||||
"name": "result-app",
|
||||
"name": "result",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "server.js",
|
15
result/tests/tests.sh
Executable file
15
result/tests/tests.sh
Executable file
@ -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
|
@ -15,4 +15,4 @@ ADD . /app
|
||||
EXPOSE 80
|
||||
|
||||
# Define our command to be run when launching the container
|
||||
CMD ["python", "app.py"]
|
||||
CMD gunicorn app:app -b 0.0.0.0:80 --log-file - --access-logfile - --workers 4 --keep-alive 0
|
3
vote/requirements.txt
Normal file
3
vote/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Flask
|
||||
Redis
|
||||
gunicorn
|
@ -1,2 +0,0 @@
|
||||
Flask
|
||||
Redis
|
Loading…
Reference in New Issue
Block a user