summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile27
-rw-r--r--docker/README.md22
2 files changed, 49 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..03ebc44
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,27 @@
+
+# Base our image on an official, minimal image of our preferred golang
+FROM golang:1.8.1
+
+# Note: The default golang docker image, already has the GOPATH env variable set.
+# GOPATH is located at /go
+ENV GO_SRC $GOPATH/src
+ENV PONZU_GITHUB github.com/ponzu-cms/ponzu
+ENV PONZU_ROOT $GO_SRC/$PONZU_GITHUB
+
+# Consider updating package in the future. For instance ca-certificates etc.
+# RUN apt-get update -qq && apt-get install -y build-essential
+
+# Make the ponzu root directory
+RUN mkdir -p $PONZU_ROOT
+
+# All commands will be run inside of ponzu root
+WORKDIR $PONZU_ROOT
+
+# Copy the ponzu source into ponzu root.
+COPY . .
+
+# the following runs the code inside of the $GO_SRC/$PONZU_GITHUB directory
+RUN go get $PONZU_GITHUB...
+
+# Define the scripts we want run once the container boots
+# CMD [ "" ]
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 0000000..6b65643
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,22 @@
+# TODO: remove from here and add to wki
+
+## Ponzu Docker build
+
+Ponzu is distributed as a [docker image](https://hub.docker.com/r/ponzu/ponzu/), which aids in docker deployment. The Dockerfile in this directory is used by ponzu to generate the docker image which contains the ponzu executable.
+
+### The following are convenient commands during development of Ponzu core.
+
+#### Build the docker image. Run from the root of the project.
+```bash
+# from the root of ponzu:
+docker build -t ponzu-dev
+```
+
+#### Start the image, share the local directory and pseudo terminal (tty) into for debugging:
+```bash
+docker run -v $(pwd):/go/src/github.com/ponzu-cms/ponzu -it ponzu-dev
+pwd # will output the go src directory for ponzu
+ponzu version # will output the ponzu version
+# make an edit on your local and rebuild
+go get github.com/ponzu-cms/ponzu/...
+```