aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-01-21 03:19:17 +0800
committerQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-01-21 03:19:17 +0800
commit6f1cac49834c0b0072e87d87405422615b6e95bd (patch)
tree05bb5f6f125f4783c1f8ab1128d251dda05beace
parent994709884e05d803e34578d74893e5e1c20da417 (diff)
Dockerize this project
-rw-r--r--Dockerfile23
-rw-r--r--README.md23
2 files changed, 46 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..bf5fd8e
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,23 @@
+FROM alpine
+MAINTAINER Quey-Liang Kao <s101062801@m101.nthu.edu.tw>
+# Last Modified: 2017/01/21
+
+ENV PATH /bin:/sbin:/usr/bin
+
+RUN apk update \
+ && apk add go git
+
+RUN mkdir -p /src/github.com/gammons/
+
+RUN git clone https://github.com/gammons/todolist.git \
+ && mv todolist /src/github.com/gammons/
+
+ENV GOPATH /
+
+RUN go install github.com/gammons/todolist
+
+CMD ["todolist", "web"]
+
+EXPOSE 7890
+
+
diff --git a/README.md b/README.md
index 202ca5c..3abc2b5 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,29 @@ See [The main Todolist website][tdl] for the current documentation.
Yes. Yes it is.
+## Quick Start using [Docker](https://github.com/docker/docker.git)
+
+Building the docker image:
+```
+$ git clone https://github.com/gammons/todolist.git
+$ cd todolist
+$ docker build -t todolist .
+```
+
+If you have an existing todo-list file, then run the container with
+```
+$ docker run -d -v your/todos/json/file:/.todos.json -p 7890:7890 todolist
+```
+
+Otherwise, you have to provide an empty todo file:
+```
+$ echo [] > /tmp/.todos.json
+$ docker run -d -v /tmp/.todos.json:/.todos.json -p 7890:7890 todolist
+```
+
+Finally, open your browser and enter `localhost:7890` at the URL, and \
+happy GTD!
+
## Author
Please send complaints, complements, rants, etc to [Grant Ammons][ga]