irish1986 / http-micro-server

A small http-micro-server for test purpose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

http-micro-server

A simple http server simulating a micro-serverice architecture from scratch.

Getting Started

This is a simple web server return code 200 written in Python. The idea is to show how things scales from here toward a micro-services archtecture. Also wile at it, I am trying to leverage as much as possible best practices.

Run the local server

task python:source
which python3
python3 app/main.py
curl -i http://localhost:8080/hello

Build container locally

Once the server works successfully, we can build it locally. Using docker.io/python:3.11.6 carries the burden of a large files size (~1GB for this little http server that does nothing significant).

The solution is to move to other options:

  • docker.io/python:3.11.6 ~1 GB
  • docker.io/python:3.11.6-slim-bookworm ~129MB
  • gcr.io/distroless/python3-debian12 ~58MB
  • Multi-stage (will get into these details later)

Distroless is really the king here !

task docker:build

About

A small http-micro-server for test purpose

License:MIT License


Languages

Language:Python 34.5%Language:HCL 34.0%Language:Dockerfile 31.5%