commit 0592061237e169d71b14e35c5d6e502709eaab5a Author: admin Date: Fri Apr 17 13:30:10 2026 +0800 feat: add demo app diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cd2b805 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM python:3.11-alpine +WORKDIR /app +COPY app.py . +EXPOSE 8080 +CMD ["python", "app.py"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..29da473 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# demo-app + +Minimal Python HTTP service used to validate the Gitea -> Tekton -> Harbor flow. + +## Local Test + +```bash +docker build -t demo-app:local . +docker run --rm -p 8080:8080 demo-app:local +curl http://127.0.0.1:8080/ +``` diff --git a/app.py b/app.py new file mode 100644 index 0000000..5b63600 --- /dev/null +++ b/app.py @@ -0,0 +1,22 @@ +from http.server import BaseHTTPRequestHandler, HTTPServer +import json + + +class Handler(BaseHTTPRequestHandler): + def do_GET(self): + payload = { + "app": "demo-app", + "status": "ok", + "path": self.path, + } + body = json.dumps(payload).encode("utf-8") + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + +if __name__ == "__main__": + server = HTTPServer(("0.0.0.0", 8080), Handler) + server.serve_forever()