Skip to content

Commit

Permalink
Merge branch 'docker' of https://github.com/skytreader/alexandria int…
Browse files Browse the repository at this point in the history
…o docker
  • Loading branch information
skytreader committed Feb 9, 2017
2 parents 29b5559 + 9a6c6c6 commit c45cdfa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ WORKDIR ./librarian
RUN apt-get update
RUN apt-get install -y libmysqlclient-dev python python-pip
RUN pip install -r requirements.txt
CMD ["python", "run.py"]
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
- "3306:3306"
web:
build: .
command: python run.py
ports:
- "80:7070"
volumes:
Expand Down
15 changes: 12 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import librarian
from config import APP_HOST, APP_PORT, DEVEL

import time
import traceback

if __name__ == "__main__":
librarian.init_blueprints()
librarian.init_db()
librarian.app.run(host=APP_HOST, port=APP_PORT, debug=DEVEL)
while True:
try:
librarian.init_blueprints()
librarian.init_db()
librarian.app.run(host=APP_HOST, port=APP_PORT, debug=DEVEL)
except Exception:
traceback.print_exc()
print "Can't start app, retrying..."
time.sleep(3)

0 comments on commit c45cdfa

Please sign in to comment.