From d0786323fd1b67ac642e2b75b40fe7f622087958 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Sun, 10 Oct 2021 12:20:18 +0100 Subject: [PATCH] Add dockerfile --- .dockerignore | 2 ++ Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3d7b4ef --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/syncv3 +.github \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ae94701 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM docker.io/golang:1.17-alpine AS base + +WORKDIR /build + +COPY . /build +RUN apk --update --no-cache add bash build-base +RUN mkdir -p bin +RUN go build -trimpath -o bin/ ./cmd/syncv3 + +FROM alpine:latest + +COPY --from=base /build/bin/* /usr/bin/ +COPY client /usr/bin/client + +ENV SYNCV3_BINDADDR="0.0.0.0:8008" + +EXPOSE 8008 + +WORKDIR /usr/bin +RUN ls -l client +ENTRYPOINT /usr/bin/syncv3 -server "${SYNCV3_SERVER}" -db "${SYNCV3_DB}" -port "${SYNCV3_BINDADDR}" \ No newline at end of file