Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

injikhr/broccoli

Repository files navigation

Injik/Broccoli

Microservice sub-repository for injik/Broccoli user management engine

Prerequisite

To develop Injik/Broccoli, the followings are required:

  • Python related: python3, pip3 and pipenv
  • MySQL / MariaDB
  • Injik/did-core

You can prepare MariaDB and did-core with pre-defined docker-compose.yaml in here

Environment variables

MARIADB_HOST            # MariaDB hostname
MARIADB_PORT            # MariaDB port
MARIADB_USER            # MariaDB username
MARIADB_PASSWORD        # MariaDB password
MARIADB_DATABASE        # MariaDB database name
RUNLEVEL                # Run mode - one of `production` or `development`
DID_HOST                # did-core service hostname
DID_PORT                # did-core service port
JWT_SECR                # JWT signing secret
FE_HOST                 # API server frontend host
FE_PORT                 # API server frontend host
ALLOWED_HOST            # Allowed host
ALLOED_CORS_ORIGIN      # CORS allowed origin

Code development

  1. Entering python virtual environment:
pipenv shell
  1. Install dependencies:
# In virtual environment (broccoli)
pipenv install
  1. Migrate to database
# In virtual environment (broccoli)
python manage.py makemigrations app
python manage.py makemigrations
python manage.py migrate app
python manage.py migrate
  1. Run
# In virtual environment (broccoli)
python manage.py runserver

Usage

As Injik/broccoli is designed to use as a Kubernetes pod, it's packaged as a Docker image.

You can find and use it in Docker hub

Here's example of how to run a container:

docker run -d \
-p 60072:7772 \
-h 0.0.0.0 \
-e ${environments ...} \
haeramkeem/brccoli

Also, docker-compose.yaml file for easy-to-use container deployment is prepared in here