

# Flask Backend

- *Pre-requisite:* Please make sure that DB container is runnning with following information available. 
    -  DB_HOST
    -  DB_NAME
    -  DB_PORT
    -  DB_USER
    -  DB_PASSWORD


    ( Note: This container is tested with MariaDB container given in DB section, in case of different DB, some minor changes would be required in app.py, flask.Dockerfile and requirements.txt files)


- Clone the repository and go to flask-backend folder. 
- Build the docker image with following command:

    `docker build -t flask-app -f flask.Dockerfile .`

- Run the flask app with relevant environment variables using following command.

    `docker run  -d --name flaskapp  -p 5000:5000  -e DB_HOST=<YOUR_DB_HOST_IP> -e DB_PORT=<YOUR_DB_PORT> -e DB_USER=<YOUR_DB_USER> -e DB_PASS=<YOUR_DB_PASSWORD> -e DB_NAME=<YOUR_DB_NAME> flask-app`


- App should be up and running on http://localhost:5000/