fix dockerfile
This commit is contained in:
parent
39744d6248
commit
c6c05193c6
1 changed files with 4 additions and 6 deletions
|
|
@ -1,9 +1,5 @@
|
||||||
# Stage 1: Build the Go binary
|
# Stage 1: Build the Go binary
|
||||||
FROM golang:1.23-alpine AS builder
|
FROM golang:1.23 AS builder
|
||||||
|
|
||||||
RUN apk update
|
|
||||||
RUN apk add git
|
|
||||||
RUN apk add curl
|
|
||||||
|
|
||||||
# Set the working directory inside the container
|
# Set the working directory inside the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -18,7 +14,9 @@ RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the Go binary for Linux
|
# Build the Go binary for Linux
|
||||||
RUN GOPRIVATE=github.com/maddalax GOPROXY=direct go run github.com/maddalax/htmgo/cli/htmgo@latest build
|
RUN CGO_ENABLED=0 GOPRIVATE=github.com/maddalax LOG_LEVEL=debug go run github.com/maddalax/htmgo/cli/htmgo@latest build
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=1 GOOS=linux go build -tags prod -o ./dist -a -ldflags '-linkmode external -extldflags "-static"' .
|
||||||
|
|
||||||
|
|
||||||
# Stage 2: Create the smallest possible image
|
# Stage 2: Create the smallest possible image
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue