diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1cbe39b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.12-alpine as builder +WORKDIR /data +COPY . . +RUN apk add --no-cache make git ca-certificates \ + make + +FROM alpine:latest +RUN apk add --no-cache ca-certificates +WORKDIR /data +COPY --from=stage /data/ddns-svc /usr/bin +COPY config.default.yml config.yml +EXPOSE 10230 +CMD ["/usr/bin/ddns-svc", "-f", "/data/config.yml"] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9d74206 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: clean build + +build: + GOOS=linux go build -o ddns-svc -ldflags "-s -w" . + +clean: + rm -rf ddns-svc && go clean \ No newline at end of file