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

Commit

Permalink
⬆️ docker: adds dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhartstonge committed May 13, 2019
1 parent 1c45a9d commit a1ee967
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.12 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"]

0 comments on commit a1ee967

Please sign in to comment.