Add docker support and docs

Bug: misc:36, misc:51
Change-Id: I43dc928e18cb481a693662f5d53b728a068422bc
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..4d53657
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.avm99963.com
+port=29418
+project=gomodules/hgu-sipsettings-reverter
+defaultbranch=main
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..61bfa3b
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,21 @@
+FROM golang:latest as builder
+
+ENV CGO_ENABLED=0
+
+ENV GO111MODULE=on
+ENV GOPROXY=https://proxy.golang.org
+
+RUN mkdir /gocache
+ENV GOCACHE /gocache
+
+WORKDIR /go/src/gomodules.avm99963.com/hgu-sipsettings-reverter
+COPY . /go/src/gomodules.avm99963.com/hgu-sipsettings-reverter
+
+RUN go install gomodules.avm99963.com/hgu-sipsettings-reverter
+
+FROM alpine
+LABEL maintainer "me@avm99963.com"
+
+RUN apk add --no-cache tini
+COPY --from=builder /go/bin/hgu-sipsettings-reverter /
+ENTRYPOINT ["/sbin/tini", "--", "/hgu-sipsettings-reverter"]
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..aa4a833
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,8 @@
+MUTABLE_VERSION ?= latest
+VERSION ?= $(shell git rev-parse --short HEAD)
+IMAGE_PROD := avm99963/hgu-sipsettings-reverter
+docker-prod: Dockerfile
+	docker build --force-rm -f Dockerfile --tag=$(IMAGE_PROD):$(VERSION) .
+	docker tag $(IMAGE_PROD):$(VERSION) $(IMAGE_PROD):$(MUTABLE_VERSION)
+push-prod: docker-prod
+	docker push $(IMAGE_PROD):$(VERSION)
diff --git a/README.md b/README.md
index c8175f7..9982651 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,11 @@
 # hgu-sipsettings-reverter
 
-A tool to revert the unwanted changes made by Telefónica to the SIP settings in the HGU Askey 3505VW all-in-one router.
+A tool to revert the unwanted changes made by Telefónica to the SIP settings in
+the HGU Askey 3505VW all-in-one router.
+
+## Setup
+
+1. Copy the `env.example` file and name it `.env`.
+1. Edit `.env` appropriately.
+1. Run `make docker-prod`.
+1. Run `docker-compose up .d`.
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..28a1edc
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,7 @@
+version: "3"
+
+services:
+  hgu-sipsettings-reverter:
+    image: "avm99963/hgu-sipsettings-reverter:latest"
+    env_file: .env
+    restart: unless-stopped
diff --git a/env.example b/env.example
new file mode 100644
index 0000000..98d50a8
--- /dev/null
+++ b/env.example
@@ -0,0 +1,16 @@
+# Copy this file to .env and change all the values.
+
+# Router address
+SIPREVERTER_HGU_ENDPOINT=http://192.168.1.1
+# Router password
+SIPREVERTER_HGU_PASSWORD=change_me
+
+# The following options are the ones which the program should overwrite when
+# they are changed.
+
+# Outbound proxy address
+SIPREVERTER_CONF_ADDRESS=change_me
+# Outbound proxy port
+SIPREVERTER_CONF_PORT=change_me
+# SIP server interface
+SIPREVERTER_CONF_INTERFACE=change_me