diff --git a/Makefile b/Makefile index 6928e17..61f54c3 100644 --- a/Makefile +++ b/Makefile @@ -126,9 +126,8 @@ build-linux: .PHONY: pack-docker # Run docker build for pack binary and assets to Docker container. pack-docker: - make test make build-linux - docker build -t $(MOD_NAME):${version} -t $(MOD_NAME):latest . + cd $(CORE_DIR) && docker build -t $(MOD_NAME):${version} -t $(MOD_NAME):latest . .PHONY: remove-debug # Remove all debug entries for reduce size binary. diff --git a/core/Dockerfile b/core/Dockerfile index a2a5639..943765f 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -2,6 +2,6 @@ FROM alpine:3.20 WORKDIR /app -COPY ../tmp/rating . +COPY ../tmp/rating-orama . -CMD ["/app/rating"] \ No newline at end of file +CMD ["/app/rating-orama"] \ No newline at end of file diff --git a/core/cmd/main.go b/core/cmd/main.go index 3f31934..11fd313 100644 --- a/core/cmd/main.go +++ b/core/cmd/main.go @@ -5,6 +5,7 @@ import ( "encoding/gob" "gopher-toolbox/db" "log/slog" + "net/http" "github.com/gofiber/fiber/v2" "github.com/gofiber/template/html/v2" @@ -23,9 +24,12 @@ func init() { //go:embed database/migrations var database embed.FS +//go:embed templates +var templates embed.FS + func main() { - engine := html.New("./views", ".html") - engine.Reload(true) + engine := html.NewFileSystem(http.FS(templates), ".gotmpl") + engine.Directory = "templates" app := app.NewExtendedApp(appName, version, ".env") app.Migrate(database) diff --git a/core/views/index.html b/core/cmd/templates/index.html similarity index 100% rename from core/views/index.html rename to core/cmd/templates/index.html diff --git a/core/views/layouts/main.html b/core/cmd/templates/layouts/main.html similarity index 100% rename from core/views/layouts/main.html rename to core/cmd/templates/layouts/main.html diff --git a/core/views/partials/footer.html b/core/cmd/templates/partials/footer.html similarity index 100% rename from core/views/partials/footer.html rename to core/cmd/templates/partials/footer.html diff --git a/core/views/tvshow.html b/core/cmd/templates/tvshow.html similarity index 100% rename from core/views/tvshow.html rename to core/cmd/templates/tvshow.html diff --git a/core/tmp/rating-orama b/core/tmp/rating-orama index 4347be6..f166468 100644 Binary files a/core/tmp/rating-orama and b/core/tmp/rating-orama differ