Skip to content

saurabh-slacklife/simba

Repository files navigation

Simba - A Flask OAuth 2.0 minimalist implementation backed by Redis and Elasticsearch

made-with-python Version 3.8.2

Docker Build

Table of contents

Installation

Setup virtual env

####OS X & Linux:

With Pipenv
# Update Pip
pip install --upgrade pip --no-cache

# Install pipenv
pip install pipenv

# Install dependencies and Virtualenv based on Pipfile
pipenv install --deploy --ignore-pipfile

Build and run

Using Docker

The service is Docker'zed. Below are the steps to build and run the Docker image.

# Below command builds the Docker image.
docker build . -f container/Dockerfile-dev -t simba:v1

# Below command runs the docker image on port 5000.
# Sets the SERVICE_ENV environment variable in Docker container.
# The value "dev" is used to take Development configuration.
docker run -p 5000:5000 --env-file ./env.dev PORT=5000 simba.io:v1

env.dev Sample

SERVICE_ENV=dev
REDIS_HOTS={redis_host}
REDIS_PORT={redis_port}
ELASTIC_SEARCH_HOST={es_host}
ELASTIC_SEARCH_port={es_port}

Using shell script

Run below commands to run the Microservice from shell script in background.

export SERVICE_ENV="dev" # Runs the application in Development configuration. Change to "qa" or "prod" based on environment.
export REDIS_HOTS={redis_host} # Cluster Host or Single Instance host
export REDIS_PORT={redis_port} # In case using single host
export ELASTIC_SEARCH_HOST={es_host} # Cluster Host pr Single instance Host
export ELASTIC_SEARCH_port={es_port} # In case using single host
chmod +x start.sh
nohup ./scripts/start.sh ${SERVICE_ENV} &

Logs

Local system

# Navigate to path /var/log/simba
cd /var/log/simba

# Gunicorn access logs path
tail -f /var/log/simba/access.log

# Application log path
tail -f /var/log/simba/application.log

Docker

# Find the docker CONTAINER_ID based on the Image tag: simba.io:v1
docker ps | grep "simba:v1" | cut -d" " -f1

# Access the docker shell
docker exec -it <CONTAINER_ID> /bin/sh

# Navigate to path /var/log/simba
cd /var/log/simba

# Gunicorn access logs path
tail -f /var/log/simba/access.log

# Application log path
tail -f /var/log/simba/application.log

Release History

//TODO

  • 1.0.0 [[Unreleased]]

Issue List

Current Issues

Contribute

If you want to be a contributor please follow the below steps.

  1. Fork it (https://github.com/saurabh-slacklife/simba/fork)
  2. Create your feature branch (git checkout -b feature/add-feature-xyz)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/add-feature-xyz)
  5. Create a new Pull Request

About

Simba - A Flask OAuth 2.0 minimalist implementation backed by Redis and Elasticsearch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published