From b63e9b43c49f1bbcf219c07cf64178bd6aebdc95 Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Mon, 31 May 2021 22:22:04 +0200 Subject: [PATCH] Initial commit --- Dockerfile | 31 +++++++++++++++++++++++++++++++ entrypoint.sh | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 Dockerfile create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ba2676b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# 3wc: golang:1.16.4-alpine3.13 is out, but giving errors on APK repositories @ +# time of writing.. +FROM golang:1.16.4-alpine3.12 + +RUN apk -U upgrade \ + && apk add -t build-dependencies git gcc musl-dev + +ENV GO_SSB_ROOM_VER=2.0.3 + +RUN cd / \ + && wget -q https://github.com/ssb-ngi-pointer/go-ssb-room/archive/refs/tags/v${GO_SSB_ROOM_VER}.tar.gz \ + && tar -xzf v${GO_SSB_ROOM_VER}.tar.gz \ + && mv go-ssb-room-${GO_SSB_ROOM_VER} app \ + && rm v${GO_SSB_ROOM_VER}.tar.gz + +WORKDIR /app + +## we run go build to compile the binary +## executable of our Go program +RUN cd cmd/server \ + && go mod download go.cryptoscope.co/secretstream \ + && go build . + +RUN apk del build-dependencies \ + && rm -rf /var/cache/apk/* /tmp/* + +COPY entrypoint.sh /docker-entrypoint.sh + +## Our start command which kicks off +## our newly created binary executable +CMD ["/docker-entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..339a4ec --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +/app/cmd/server/server -https-domain "$DOMAIN"