aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..069309c
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,29 @@
+FROM marketplace.gcr.io/google/debian11 AS build
+
+ENV BUILD_DEPS 'curl git gcc patch libc6-dev ca-certificates build-essential pkg-config libmagickwand-dev libmagickwand-6-headers'
+RUN apt-get update && apt-get install -y ${BUILD_DEPS} --no-install-recommends
+
+ENV GOPATH=/go
+ENV GOROOT_BOOTSTRAP=/usr/local/go-bootstrap
+RUN curl -sSL https://dl.google.com/go/go1.17.2.linux-amd64.tar.gz -o /tmp/go.tar.gz
+RUN mkdir -p $GOROOT_BOOTSTRAP
+RUN tar --strip=1 -C $GOROOT_BOOTSTRAP -xzf /tmp/go.tar.gz
+RUN $GOROOT_BOOTSTRAP/bin/go install golang.org/dl/gotip@latest
+#RUN /go/bin/gotip download
+
+RUN mkdir -p /workdir
+WORKDIR /workdir
+
+COPY go.mod /workdir
+COPY go.sum /workdir
+RUN $GOROOT_BOOTSTRAP/bin/go mod download
+
+COPY . /workdir
+RUN $GOROOT_BOOTSTRAP/bin/go build ./cmd/server
+
+ENV PORT=8080
+
+RUN mkdir -p /app
+RUN mv /workdir/server /app
+
+ENTRYPOINT /app/server