Skip to content

Commit

Permalink
ci: add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lmquang committed Nov 8, 2024
1 parent 3bce4dd commit 1675391
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
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" ]

0 comments on commit 1675391

Please sign in to comment.