From: Joshua May Date: Sun, 1 Sep 2019 05:04:58 +0000 (-0700) Subject: Hey, we can actually get the database set up when we launch with Docker now. Whoops. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=41c455ec203d5827e12b5ccc478cc744333faf0f;p=sirius.git Hey, we can actually get the database set up when we launch with Docker now. Whoops. --- diff --git a/.env.example b/.env.example index 6e70c07..a80b980 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,6 @@ FLASK_CONFIG=heroku +# TWITTER_CONSUMER_KEY= +# TWITTER_CONSUMER_SECRET= # default development database via Docker: # DEV_DATABASE_URL=postgresql://postgres:plop@sirius-database/sirius-dev \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3dda9b3..8595645 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,3 @@ RUN pip install honcho EXPOSE 5000 ADD . . - -ENTRYPOINT honcho start diff --git a/bin/wait-for-it.sh b/bin/wait-for-it.sh old mode 100644 new mode 100755 diff --git a/docker-compose.development.yml b/docker-compose.development.yml index 6f93d16..a3e7677 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -6,7 +6,13 @@ services: - 5000:5000 depends_on: - sirius-database - command: ["/bin/wait-for-it.sh", "db:5342", "--", "./manage.py db upgrade"] + command: + [ + "bin/wait-for-it.sh", + "sirius-database:5432", + "--", + "bin/docker-entrypoint.sh", + ] environment: - VIRTUAL_HOST=sirius.localhost @@ -17,6 +23,7 @@ services: ports: - "32770:5432" environment: + - POSTGRES_DB=sirius-dev - POSTGRES_PASSWORD=plop sirius-web: diff --git a/manage.py b/manage.py index 0105f2c..6aff4cf 100755 --- a/manage.py +++ b/manage.py @@ -1,11 +1,16 @@ #!/usr/bin/env python2.7 import os, sys +import re if os.path.exists('.env'): print('Importing environment from .env...') + regex = re.compile(r"#.*$") # strip comments for line in open('.env'): - name, value = line.strip().split('=', 1) + kv = regex.sub("", line).strip() + if '=' not in kv: + continue + name, value = kv.split('=', 1) os.environ[name] = value from sirius.web import webapp