diff --git a/.dockerignore b/.dockerignore index a975cf5..294de3c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,4 +5,5 @@ data/ .mypy_cache/ .ruff_cache/ .env -sqlite-db/ \ No newline at end of file +sqlite-db/ +temp/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index d500152..b821613 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ docker.env __pycache__/ *.so todo.md +temp/ # Distribution / packaging .Python diff --git a/Makefile b/Makefile index da0320b..e0ea784 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,12 @@ -.PHONY: run check ruff database lint docker-build docker-push +.PHONY: run check ruff database lint docker-build docker-push docker-buildx-prepare docker-release # Get version from pyproject.toml VERSION := $(shell grep -m1 version pyproject.toml | cut -d'"' -f2) IMAGE_NAME := lfnovo/open_notebook + +# Plataformas mais comumente suportadas pela imagem Python +PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7,linux/386 + database: docker compose up -d @@ -15,13 +19,26 @@ lint: ruff: ruff check . --fix -docker-build: - docker build . -t $(IMAGE_NAME):$(VERSION) - docker tag $(IMAGE_NAME):$(VERSION) $(IMAGE_NAME):latest +# Configuração do buildx para multi-plataforma +docker-buildx-prepare: + docker buildx create --use --name multi-platform-builder || true +# Build multi-plataforma com buildx +docker-build: docker-buildx-prepare + docker buildx build \ + --platform $(PLATFORMS) \ + -t $(IMAGE_NAME):$(VERSION) \ + -t $(IMAGE_NAME):latest \ + --push \ + . + +# O push já é feito durante o build com buildx docker-push: - docker push $(IMAGE_NAME):$(VERSION) - docker push $(IMAGE_NAME):latest + @echo "Push já foi realizado durante o build com buildx" -# Combined build and push -docker-release: docker-build docker-push \ No newline at end of file +# Build e push combinados +docker-release: docker-build + +# Comando útil para verificar as plataformas suportadas após o build +docker-check-platforms: + docker manifest inspect $(IMAGE_NAME):$(VERSION) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 44f5341..d219602 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "open-notebook" -version = "0.0.1" +version = "0.0.2" description = "An open source implementation of a research assistant, inspired by Google Notebook LM" authors = ["Luis Novo "] license = "MIT"