From 33cf2dcac7e921eea8db899173c2f5d5fca75d7f Mon Sep 17 00:00:00 2001 From: maddalax Date: Tue, 24 Sep 2024 12:46:17 -0500 Subject: [PATCH] fix docker --- examples/todo-list/.dockerignore | 3 ++- examples/todo-list/Dockerfile | 7 ++++--- htmgo-site/.dockerignore | 3 ++- htmgo-site/Dockerfile | 9 +++++---- htmgo-site/go.mod | 2 +- htmgo-site/go.sum | 2 ++ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/examples/todo-list/.dockerignore b/examples/todo-list/.dockerignore index b66eed5..fb47686 100644 --- a/examples/todo-list/.dockerignore +++ b/examples/todo-list/.dockerignore @@ -7,4 +7,5 @@ js/node_modules go.work go.work.sum .idea -!framework/assets/dist \ No newline at end of file +!framework/assets/dist +__htmgo \ No newline at end of file diff --git a/examples/todo-list/Dockerfile b/examples/todo-list/Dockerfile index 426cd90..b8b50e0 100644 --- a/examples/todo-list/Dockerfile +++ b/examples/todo-list/Dockerfile @@ -10,12 +10,13 @@ COPY go.mod go.sum ./ # Download and cache the Go modules RUN go mod download -# Always download the latest version of the framework -RUN go get github.com/maddalax/htmgo/framework@latest - # Copy the source code into the container COPY . . +# Always download the latest version of the framework +RUN go get github.com/maddalax/htmgo/framework@latest +RUN go mod tidy + # Build the Go binary for Linux RUN CGO_ENABLED=0 GOPRIVATE=github.com/maddalax LOG_LEVEL=debug go run github.com/maddalax/htmgo/cli/htmgo@latest build diff --git a/htmgo-site/.dockerignore b/htmgo-site/.dockerignore index b66eed5..fb47686 100644 --- a/htmgo-site/.dockerignore +++ b/htmgo-site/.dockerignore @@ -7,4 +7,5 @@ js/node_modules go.work go.work.sum .idea -!framework/assets/dist \ No newline at end of file +!framework/assets/dist +__htmgo \ No newline at end of file diff --git a/htmgo-site/Dockerfile b/htmgo-site/Dockerfile index 205ff5e..695ac2d 100644 --- a/htmgo-site/Dockerfile +++ b/htmgo-site/Dockerfile @@ -14,14 +14,15 @@ COPY go.mod go.sum ./ # Download and cache the Go modules RUN go mod download -# Always download the latest version of the framework -RUN go get github.com/maddalax/htmgo/framework@latest - # Copy the source code into the container COPY . . +# Always download the latest version of the framework +RUN go get github.com/maddalax/htmgo/framework@latest +RUN go mod tidy + # Build the Go binary for Linux -RUN GOPRIVATE=github.com/maddalax go run github.com/maddalax/htmgo/cli/htmgo@latest build +RUN LOG_LEVEL=debug GOPRIVATE=github.com/maddalax GOPROXY=direct go run github.com/maddalax/htmgo/cli/htmgo@latest build # Stage 2: Create the smallest possible image diff --git a/htmgo-site/go.mod b/htmgo-site/go.mod index b5062cd..469d0a0 100644 --- a/htmgo-site/go.mod +++ b/htmgo-site/go.mod @@ -4,7 +4,7 @@ go 1.23.0 require ( github.com/labstack/echo/v4 v4.12.0 - github.com/maddalax/htmgo/framework v0.0.0-20240923170417-9e23e7cf2bea + github.com/maddalax/htmgo/framework v0.0.0-20240924173916-2b8ba6e1aa58 github.com/mattn/go-sqlite3 v1.14.16 github.com/yuin/goldmark v1.7.4 github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc diff --git a/htmgo-site/go.sum b/htmgo-site/go.sum index 1d172e7..b9dcde3 100644 --- a/htmgo-site/go.sum +++ b/htmgo-site/go.sum @@ -16,6 +16,8 @@ github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0 github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= github.com/maddalax/htmgo/framework v0.0.0-20240923170417-9e23e7cf2bea h1:TcZtFXyrJ86nPK6YBeOtkzjYbFMxiPNDJzvmaKRfB/c= github.com/maddalax/htmgo/framework v0.0.0-20240923170417-9e23e7cf2bea/go.mod h1:TA7KCaKhurpXceQrzClJOHqRsUSd5NL64ZngSg+I3oc= +github.com/maddalax/htmgo/framework v0.0.0-20240924173916-2b8ba6e1aa58 h1:xvBCxG0r2XJHPIb5q994lbZJVPxIOxCRsxoFj5mtlO4= +github.com/maddalax/htmgo/framework v0.0.0-20240924173916-2b8ba6e1aa58/go.mod h1:TA7KCaKhurpXceQrzClJOHqRsUSd5NL64ZngSg+I3oc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=