Skip to content

Instructions to Run (3 of 3): Run Project

Benjamin Klieger edited this page Oct 29, 2023 · 1 revision

Instructions to Run (1 of 3)

Run Project

Run With Docker

To build the docker image

docker build -f Dockerfile.norail -t ai4collab:latest .

Run docker image in same directory as env file

docker run --env-file {DEPLOYMENT}.env -p 8000:8000 ai4collab:latest

DEPLOYMENT = local, development, or production. Run with -d for detached.

The application is now up and running! You can check the status of the deployment for any errors in the logs.

Run Without Docker

To create virtual env

python -m venv venv

To activate virtual env

source venv/bin/activate

To install libraries

pip install -r requirements.txt

Set environment variables

touch {DEPLOYMENT}.env

DEPLOYMENT = local, development, or production

export $(cat {DEPLOYMENT}.env | xargs)

Check status for production

python manage.py test
python manage.py check --deploy

Initialize or update database

python manage.py makemigrations
python manage.py migrate

Collect static files

python manage.py collectstatic

Create superuser (optional)

python manage.py createsuperuser

Run server with Uvicorn

uvicorn ai4collab.asgi:application

Run server with Gunicorn running Uvicorn Workers

gunicorn --bind 0.0.0.0:8000 --workers 4 -k uvicorn.workers.UvicornWorker ai4collab.asgi:application

The application is now up and running! You can check the status of the deployment for any errors in the logs, or visit /deployment while logged in as a superadmin through the admin panel at /admin.