Skip to content

Commit

Permalink
fix: Try Again Docker Scratch
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Ilham <muhd.iiilham@gmail.com>
  • Loading branch information
mhdiiilham committed Jan 24, 2023
1 parent 0a07649 commit e58c2e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ RUN apk update && apk add --no-cache git
WORKDIR /btc-billionaire
COPY . /btc-billionaire/
RUN go mod tidy
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o btc-billionaire cmd/main.go
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags="-s -w" -o btc-billionaire cmd/main.go

FROM scratch
WORKDIR /server
COPY --from=builder /btc-billionaire/btc-billionaire /server/btc-billionaire
COPY --from=builder /btc-billionaire/app.env /server/app.env
# RUN mkdir /server
# WORKDIR /server
COPY --from=builder /btc-billionaire/btc-billionaire .
COPY --from=builder /btc-billionaire/app.env .
EXPOSE 8089
CMD [ "/server/btc-billionaire" ]
CMD [ "/btc-billionaire" ]

0 comments on commit e58c2e6

Please sign in to comment.