Skip to content

Commit

Permalink
feat: docker support (#3)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: Anton Ovchinnikov <[email protected]>
  • Loading branch information
aldy505 and tonyo authored May 8, 2023
1 parent acbc443 commit 7976271
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG GOVERSION=latest
FROM golang:$GOVERSION AS builder

WORKDIR /src
COPY . .

RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o . -ldflags="-s -w" .

FROM alpine:3

RUN apk add --no-cache ca-certificates tzdata
COPY ./docker-entrypoint.sh /
COPY --from=builder /src/sentlog /bin/sentlog
ENTRYPOINT ["/docker-entrypoint.sh"]
10 changes: 10 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# For compatibility with older entrypoints
if [ "${1}" == "sentlog" ]; then
shift
elif [ "${1}" == "sh" ] || [ "${1}" == "/bin/sh" ]; then
exec "$@"
fi

exec /bin/sentlog "$@"

0 comments on commit 7976271

Please sign in to comment.