Skip to content

Commit

Permalink
update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Aug 6, 2024
1 parent 0ab1240 commit 10eee06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ARG NPM_DIR

WORKDIR "/go/src/${REPO}/"

ENV CGO_ENABLED=0
COPY ./go.mod ./go.sum "/go/src/${REPO}/"
RUN go mod download
COPY . "/go/src/${REPO}"
Expand All @@ -45,7 +46,7 @@ COPY --from=WEB_BUILD "/web/dist" "/go/src/${REPO}/${NPM_DIR}/dist"
ENV ldflags="-X 'github.com/LiterMC/go-openbmclapi/internal/build.BuildVersion=$TAG'"

RUN --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 go build -v -o "/go/bin/go-openbmclapi" -ldflags="$ldflags" "."
go build -v -o "/go/bin/go-openbmclapi" -ldflags="$ldflags" "."

FROM alpine:latest

Expand All @@ -54,4 +55,4 @@ COPY ./config.yaml /opt/openbmclapi/config.yaml

COPY --from=BUILD "/go/bin/go-openbmclapi" "/go-openbmclapi"

CMD ["/go-openbmclapi"]
ENTRYPOINT ["/go-openbmclapi"]

0 comments on commit 10eee06

Please sign in to comment.