fix build command
This commit is contained in:
parent
1a756b7157
commit
258566822e
2 changed files with 5 additions and 11 deletions
|
|
@ -2,6 +2,7 @@ package run
|
|||
|
||||
import (
|
||||
"github.com/maddalax/htmgo/cli/htmgo/tasks/astgen"
|
||||
"github.com/maddalax/htmgo/cli/htmgo/tasks/copyassets"
|
||||
"github.com/maddalax/htmgo/cli/htmgo/tasks/css"
|
||||
"github.com/maddalax/htmgo/cli/htmgo/tasks/process"
|
||||
)
|
||||
|
|
@ -9,19 +10,12 @@ import (
|
|||
func Build() {
|
||||
astgen.GenAst(process.ExitOnError)
|
||||
css.GenerateCss(process.ExitOnError)
|
||||
|
||||
copyassets.CopyAssets()
|
||||
|
||||
process.RunOrExit("rm -rf ./dist")
|
||||
process.RunOrExit("mkdir -p ./dist")
|
||||
|
||||
//process.RunOrExit("mkdir -p ./dist/assets/dist")
|
||||
|
||||
//dirutil.CopyDir(
|
||||
// "./assets/dist",
|
||||
// "./dist/assets/dist",
|
||||
// func(path string, exists bool) bool {
|
||||
// return true
|
||||
// },
|
||||
//)
|
||||
|
||||
process.RunOrExit("env GOOS=linux GOARCH=amd64 go build -o ./dist/app-linux-amd64 .")
|
||||
process.RunOrExit("go build -o ./dist/app .")
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ RUN go mod download
|
|||
COPY . .
|
||||
|
||||
# Build the Go binary for Linux
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go run github.com/maddalax/htmgo/cli/htmgo@latest build
|
||||
|
||||
# Stage 2: Create the smallest possible image
|
||||
FROM gcr.io/distroless/base-debian11
|
||||
|
|
|
|||
Loading…
Reference in a new issue