I built a simple flask app that uses postgres for backend and plain html for frontend. The source can be found in https://codeberg.org/boink/cloud-scripts/src/branch/master/week-9/main.py
I used the postgres official docker image and constructed a docker-compose script to launch the app. The docker compose script is:
services:
frontend:
image: flask-fe
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_PORT=5432
depends_on:
- postgres
ports:
- 5000:5000
postgres:
image: postgres
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=ubuntu
It is as simple as it gets!