From 83d2d2a1c937a42449fef7b8a09afd1897657639 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 9 Mar 2022 19:00:35 -0700 Subject: [PATCH] Building docker containers in parallel. --- README.md | 14 ++++++++------ wrolpi/conftest.py | 2 -- wrolpi/db.py | 4 +--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6b651ce7..0dcf18b4 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ network so that any person with a laptop/tablet/phone can connect and use the da - [x] Food Inventory management - [x] Wi-Fi Hotspot - [x] Universal search -- [x] Map viewer & downloader +- [x] Map viewer - [ ] eBook viewer - [ ] Wiki viewer & downloader - [ ] Synchronizer and/or duplicator @@ -48,16 +48,18 @@ You can try out WROLPi by running the docker containers. * `git clone git@github.com:lrnselfreliance/wrolpi.git` 3. Change directory into the code base * `cd wrolpi` -4. Start the database. +4. Build the containers + * `docker-compose build --parallel` +5. Start the database. * `docker-compose up -d db` -5. Initialize the database +6. Initialize the database * `docker-compose run --rm api db upgrade` -6. Create volumes +7. Create volumes * `docker volume create --name=openstreetmap-data` * `docker volume create --name=openstreetmap-rendered-tiles` -7. Start the docker containers +8. Start the docker containers * `docker-compose up` -8. Navigate to WROLPi +9. Browse to WROLPi * http://0.0.0.0:8080 # RaspberryPi Install diff --git a/wrolpi/conftest.py b/wrolpi/conftest.py index cf6c62d0..69d79308 100644 --- a/wrolpi/conftest.py +++ b/wrolpi/conftest.py @@ -19,8 +19,6 @@ from wrolpi.db import postgres_engine, get_db_args from wrolpi.downloader import DownloadManager from wrolpi.root_api import BLUEPRINTS, api_app -os.environ['DB_PORT'] = '54321' - def get_test_db_engine(): suffix = str(uuid1()).replace('-', '') diff --git a/wrolpi/db.py b/wrolpi/db.py index fe1c03ad..86e5d824 100644 --- a/wrolpi/db.py +++ b/wrolpi/db.py @@ -26,11 +26,9 @@ def get_db_args(dbname: str = None): # Deployed in docker, use the docker database. db_args['user'] = 'postgres' db_args['host'] = 'db' - db_args['port'] = 5432 elif PYTEST: - # Pytest is running but we're not in docker, use the exposed docker container port. + # Pytest is running, but we're not in docker, use the exposed docker container port. db_args['user'] = 'postgres' - db_args['port'] = 5432 return db_args