#!/usr/bin/env bash

if [ "$ENVIRONMENT" = "PRODUCTION" ]; then
    echo "Running in production mode"
else
    echo "Running in development mode"
    set -a  # automatically export all variables
    source .env
    set +a
    export PORT=8000
fi

gunicorn -c gunicorn.conf.py aiservice.asgi:application --bind 0.0.0.0:"$PORT" --timeout 600 --workers 2
