-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chapter 17: Docker Compose support (17f)
- Loading branch information
1 parent
c016fe3
commit fa8b325
Showing
3 changed files
with
28 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 |
---|---|---|
|
@@ -40,3 +40,7 @@ nosetests.xml | |
|
||
# Virtual environment | ||
venv | ||
|
||
# Environment files | ||
.env | ||
.env-mysql |
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
#!/bin/sh | ||
source venv/bin/activate | ||
flask deploy | ||
|
||
while true; do | ||
flask deploy | ||
if [[ "$?" == "0" ]]; then | ||
break | ||
fi | ||
echo Deploy command failed, retrying in 5 secs... | ||
sleep 5 | ||
done | ||
|
||
exec gunicorn -b :5000 --access-logfile - --error-logfile - flasky:app |
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,14 @@ | ||
version: '3' | ||
services: | ||
flasky: | ||
build: . | ||
ports: | ||
- "8000:5000" | ||
env_file: .env | ||
restart: always | ||
links: | ||
- mysql:dbserver | ||
mysql: | ||
image: "mysql/mysql-server:5.7" | ||
env_file: .env-mysql | ||
restart: always |