-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 changed file
with
26 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM dwarvesf/sql-migrate as sql-migrate | ||
|
||
FROM golang:1.23-alpine as builder | ||
RUN mkdir /build | ||
WORKDIR /build | ||
COPY . . | ||
|
||
ENV GOOS=linux GOARCH=amd64 CGO_ENABLED=0 | ||
|
||
RUN set -ex && \ | ||
apk add --no-progress --no-cache \ | ||
gcc \ | ||
musl-dev | ||
RUN go install --tags musl ./... | ||
|
||
FROM alpine:3.15.0 | ||
RUN apk --no-cache add ca-certificates | ||
RUN ln -fs /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime | ||
WORKDIR / | ||
|
||
COPY --from=sql-migrate /usr/local/bin/sql-migrate /usr/bin/ | ||
COPY --from=builder /go/bin/* /usr/bin/ | ||
# COPY migrations /migrations | ||
# COPY dbconfig.yml / | ||
|
||
ENTRYPOINT [ "server" ] |