Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Adds an official docker image #144

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.17 as build-env
ADD . /opt/gaurun
RUN cd /opt/gaurun/cmd/gaurun &&\
go build -tags=internal -a -ldflags="-s -w -linkmode external -extldflags -static" -v &&\
cd /opt/gaurun/cmd/gaurun_recover &&\
go build -tags=internal -a -ldflags="-s -w -linkmode external -extldflags -static" -v

FROM alpine:latest
RUN apk add --no-cache ca-certificates tzdata &&\
addgroup -g 1000 -S gaurun &&\
adduser -u 1000 -S gaurun -G gaurun
COPY --from=build-env /opt/gaurun/cmd/gaurun/gaurun /app/
COPY --from=build-env /opt/gaurun/cmd/gaurun_recover/gaurun_recover /app/
COPY ./conf/gaurun.toml /app/conf/gaurun.toml
USER gaurun
WORKDIR /app
EXPOSE 1056
CMD ["./gaurun", "-c", "conf/gaurun.toml"]