forked from ustcck/docker-k8s-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Peng Xiao <[email protected]>
- Loading branch information
1 parent
8ce5c90
commit b37ddcf
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
def hello(): | ||
return "hello docker" | ||
if __name__ == '__main__': | ||
app.run() | ||
app.run(host="0.0.0.0", port=5000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
|
||
# RAFT 通俗解释 | ||
|
||
http://thesecretlivesofdata.com/raft/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
adminadmin |