logan-connolly / flask-distroless

💿 Example Distroless Flask App

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Goal

Create a Flask API that runs on a Distroless image from GoogleContainerTools/distroless

Requirements:

  • install flask and create Hello World app
  • install gunicorn to make sure that it runs not just with werkzeug dev server
  • install a couple packages that rely on underlying C-libs like numpy and pandas to make sure that distroless output image still runs when dependencies are copied over

Why?

Avoid the headache of security scanners. More distro dependencies = more problems.

Setup

After cloning the repo, build via:

docker build -t flask-distroless:dev .

and run the built image (exposing port 5000) with:

docker run -d -p 5000:5000 flask-distroless:dev

You should see the hello world response at localhost:5000

Inspiration

About

💿 Example Distroless Flask App


Languages

Language:Dockerfile 75.9%Language:Python 24.1%