diff --git a/.containifyci/containifyci.go b/.containifyci/containifyci.go index e61c69a..d254a6a 100644 --- a/.containifyci/containifyci.go +++ b/.containifyci/containifyci.go @@ -12,12 +12,27 @@ import ( "github.com/containifyci/engine-ci/protos2" ) +func registryAuth() map[string]*protos2.ContainerRegistry { + return map[string]*protos2.ContainerRegistry{ + "docker.io": { + Username: "env:DOCKER_USER", + Password: "env:DOCKER_TOKEN", + }, + "ghcr.io": { + Username: "USERNAME", + Password: "env:GHCR_TOKEN", + }, + } +} + func main() { os.Chdir("../") // Build Group 0 enginepython := build.NewPythonServiceBuild("engine-python") enginepython.Folder = "." + enginepython.File = "engine_python" + enginepython.Registries = registryAuth() //TODO: adjust the registries to your own container registry build.BuildGroups( diff --git a/app.py b/engine_python.py similarity index 62% rename from app.py rename to engine_python.py index f9e66b6..6f0d10c 100644 --- a/app.py +++ b/engine_python.py @@ -1,4 +1,5 @@ # app.py +import uvicorn from fastapi import FastAPI app = FastAPI() @@ -6,3 +7,6 @@ @app.get("/hello") def hello(name: str = "world"): return {"message": f"hello {name}."} + +if __name__ == "__main__": + uvicorn.run(app, host="0.0.0.0", port=8000) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c3b1e99..e37b612 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,16 @@ [project] -name = "engine-python" +name = "engine_python" version = "0.1.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.13" dependencies = [ - "fastapi>=0.119.0", + "fastapi[standard]>=0.119.0", "uvicorn>=0.37.0", ] + +[tool.setuptools] +py-modules = ["engine_python"] + +[project.scripts] +engine-python = "engine_python:main" \ No newline at end of file