-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
FROM golang:1.21 | ||
FROM golang:1.21 AS builder | ||
|
||
# Copy metaploy configuration | ||
COPY metaploy/heimdall.metaploy.conf / | ||
COPY metaploy/postinstall.sh / | ||
WORKDIR /src | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY mail.go main.go ./ | ||
|
||
RUN CGO_ENABLED=1 GOOS=linux go build -o ./heimdall --tags "fts5" -a -ldflags '-linkmode external -extldflags "-static"' . | ||
|
||
FROM alpine:latest AS app | ||
|
||
ENV TZ="Asia/Kolkata" | ||
|
||
RUN apk --no-cache add ca-certificates tzdata nginx bash | ||
|
||
# Copy source files | ||
WORKDIR / | ||
COPY go.mod go.sum main.go mail.go / | ||
|
||
# Build go package | ||
RUN go build | ||
COPY metaploy/heimdall.metaploy.conf metaploy/postinstall.sh ./ | ||
|
||
RUN chmod +x ./postinstall.sh | ||
|
||
COPY --from=builder /src/heimdall . | ||
|
||
# Run postinstall script and the binary | ||
CMD ["/postinstall.sh", "/heimdall"] | ||
CMD ["./postinstall.sh", "./heimdall"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters