PostgreSQL, YML & Dockerfile - PostgreSQL as a microservice

Use psycopg to connect to a PostgreSQL database instance from a Flask application. You'll need to begin by creating a database connection and then a new execute() function with the help of RealDictCursor from the psycopg2 module, where your data should be in JSON format. Create a simple microservice (as a configuration in .yml) where startup command is your flask application and execution command containing path (as defined in execute function()) with a simple SELECT statement with your JSON data under the content. Also, create a Docker container to spin up your Flask application.

The output should always return in an array with records as JSON objects in it.

The expected submission for this project will be the flask application code, postgreSQL_microservice.yml configuration file and a Dockerfile with step-by-step document illustrating the steps you took in addition to screenshots showing your progress.

Task tags

  • flask
  • application
  • docker
  • postgresql
  • yml

Students who completed this task


Task type

  • code Code