TEST a FLASK Application Lets Write a Flask Application with multiple endpoints app.py from flask import Flask, jsonify, request app = Flask( __name__ ) @app.route ( '/' , methods = [ 'GET' ]) def hello (): message = 'Welcome to Flask Application!' return jsonify({ 'message' : message}) @app.route ( '/add/task' , methods = [ 'POST' ]) def add_task (): data = request.get_json() for d in data: title = d.get( 'title' ) priority = d.get( 'priority' ) assignto = d.get( 'assignto' ) if ( len (title) == 0 or len (priority) == 0 or len (assignto) == 0 ): message = 'Please fill all the required fields' return jsonify({ 'message' : message}), 400 message = 'Task added succe...
Docker + Docker Compose + Ansible ----------------------------------------------------------------------------------------------------------------------------- Flask Application Deployment using Ansible roles and Docker-Compose 1. Run the "setup.sh" file given in the path to install the required dependencies before starting the challenge. 2. A Flask application named "app.py" is given in the path . 3. Create an Ansible role named "Installation" in the path "/etc/ansible/roles" to install docker-compose. 4. Write an Ansible playbook named "creation.yaml" in the path , to perform the following tasks: 1. Using "file" and "copy" modules, create a Multi-stage "Dockerfile" in the path to - Dockerize the given Flask application with "python:alpine3.7" as its base image, using the given 'requirements.txt' file. - Build an image using "postgres" as its base image. 2. Using ...