There are two scripts for deploying the portal, cpg.sh (Clone Portal from Github) and mpb.sh (Move Portal Build). cpg.sh should be run in beta_portal_user or portal_user's home directory, as that is where the build is done. mpb.sh should be run in a wheel user's home directory, as the script requires sudo permissions to move the build from beta_portal_user or portal_user's home directory. In summary,
- cpg.sh (Clone Portal from Github) - Run in beta_portal_user or portal_user's home directory.
- mpb.sh (Move Portal Build) - Run in a wheel user's home directory using "sudo mpb.sh".
The git folder (application) that contains all of the user information for the portal is /portal/userdb/. You'll want to create a virtual environment and a super user to administer the user application using the following steps.
- cd /portal/userdb/
- virtualenv env
- source env/bin/activate
- cd portalusers
- pip3 install -r requirements.txt
- python3 manage.py makemigrations
- python3 manage.py migrate
- python3 manage.py createsuperuser (fill out the information)
(Optional) If you're not using nginx and gunicorn, you can serve the application directly by following these steps.
- python3 manage.py runserver 8000
The web portal can be containerized for easier development and deployment.
You can build the container by running the build command:
docker build -t bco_portal .
You can run the container via docker through the following command:
docker run --network host --rm -t bco_portal
This will set the portal to be available at localhost:3000
on the host machine.