Skip to content

Commit

Permalink
chapter7
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Xiao <[email protected]>
  • Loading branch information
xiaopeng163 committed Feb 3, 2018
1 parent 8ce5c90 commit b37ddcf
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chapter3/labs/flask-hello-world/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
def hello():
return "hello docker"
if __name__ == '__main__':
app.run()
app.run(host="0.0.0.0", port=5000)
5 changes: 5 additions & 0 deletions chapter7/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


# RAFT 通俗解释

http://thesecretlivesofdata.com/raft/
55 changes: 55 additions & 0 deletions chapter7/labs/secret-example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: '3'

services:

web:
image: wordpress
ports:
- 8080:80
secrets:
- my-pw
environment:
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_PASSWORD_FILE: /run/secrets/my-pw
networks:
- my-network
depends_on:
- mysql
deploy:
mode: replicated
replicas: 3
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
update_config:
parallelism: 1
delay: 10s

mysql:
image: mysql
secrets:
- my-pw
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/my-pw
MYSQL_DATABASE: wordpress
volumes:
- mysql-data:/var/lib/mysql
networks:
- my-network
deploy:
mode: global
placement:
constraints:
- node.role == manager

volumes:
mysql-data:

networks:
my-network:
driver: overlay

# secrets:
# my-pw:
# file: ./password
1 change: 1 addition & 0 deletions chapter7/labs/secret-example/password
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
adminadmin

0 comments on commit b37ddcf

Please sign in to comment.