]> git.aero2k.de Git - sirius.git/commitdiff
Hey, we can actually get the database set up when we launch with Docker now. Whoops.
authorJoshua May <notjosh@gmail.com>
Sun, 1 Sep 2019 05:04:58 +0000 (22:04 -0700)
committerJoshua May <notjosh@gmail.com>
Sun, 1 Sep 2019 05:04:58 +0000 (22:04 -0700)
.env.example
Dockerfile
bin/wait-for-it.sh [changed mode: 0644->0755]
docker-compose.development.yml
manage.py

index 6e70c07d5789352a8606747c8bf4cdccbf2c1ad7..a80b980f677222c6680e78e3a32ae6ab90baa984 100644 (file)
@@ -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
index 3dda9b3fc02503d382d547d1231fca8b9f4a7766..85956457da4a15f480fd96b234a67e9e66a47b03 100644 (file)
@@ -21,5 +21,3 @@ RUN pip install honcho
 EXPOSE 5000
 
 ADD . .
-
-ENTRYPOINT honcho start
old mode 100644 (file)
new mode 100755 (executable)
index 6f93d1642b7606887a0e7a8cf38445362d5bf57d..a3e7677d7c9faebc072856256bffdeb3d01a4af3 100644 (file)
@@ -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:
index 0105f2c5d830271d362dc443edb0be8ab9d6378f..6aff4cf985428123a12b24f113f7ce7a1db6b234 100755 (executable)
--- 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