Kenneth Bruen
11 months ago
2 changed files with 49 additions and 0 deletions
@ -0,0 +1,25 @@
|
||||
### Go template |
||||
# If you prefer the allow list template instead of the deny list, see community template: |
||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore |
||||
# |
||||
# Binaries for programs and plugins |
||||
*.exe |
||||
*.exe~ |
||||
*.dll |
||||
*.so |
||||
*.dylib |
||||
|
||||
# Test binary, built with `go test -c` |
||||
*.test |
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE |
||||
*.out |
||||
|
||||
# Dependency directories (remove the comment below to include it) |
||||
# vendor/ |
||||
|
||||
# Go workspace file |
||||
go.work |
||||
|
||||
# Also ignore the Dockerfile |
||||
Dockerfile |
@ -0,0 +1,24 @@
|
||||
FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS build |
||||
|
||||
LABEL authors="kbruen" |
||||
LABEL org.opencontainers.image.source=https://github.com/dancojocaru2000/CfrTrainInfoTelegramBot |
||||
|
||||
WORKDIR /app |
||||
|
||||
COPY go.mod . |
||||
COPY go.sum . |
||||
RUN go mod download |
||||
|
||||
COPY main.go ./ |
||||
COPY pkg ./pkg/ |
||||
ARG TARGETOS TARGETARCH |
||||
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o server |
||||
|
||||
FROM scratch |
||||
COPY --from=build /etc/ssl/certs /etc/ssl/certs |
||||
WORKDIR /app |
||||
# COPY static ./static/ |
||||
COPY --from=build /app/server ./ |
||||
|
||||
ENV DEBUG=false |
||||
ENTRYPOINT [ "/app/server" ] |
Loading…
Reference in new issue