aboutsummaryrefslogtreecommitdiff
path: root/build/scripts/Complement.Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'build/scripts/Complement.Dockerfile')
-rw-r--r--build/scripts/Complement.Dockerfile22
1 files changed, 22 insertions, 0 deletions
diff --git a/build/scripts/Complement.Dockerfile b/build/scripts/Complement.Dockerfile
new file mode 100644
index 00000000..6489c22e
--- /dev/null
+++ b/build/scripts/Complement.Dockerfile
@@ -0,0 +1,22 @@
+FROM golang:1.13-stretch as build
+RUN apt-get update && apt-get install sqlite3
+WORKDIR /build
+
+# Utilise Docker caching when downloading dependencies, this stops us needlessly
+# downloading dependencies every time.
+COPY go.mod .
+COPY go.sum .
+RUN go mod download
+
+COPY . .
+RUN go build ./cmd/dendrite-monolith-server
+RUN go build ./cmd/generate-keys
+RUN go build ./cmd/generate-config
+RUN ./generate-config > dendrite.yaml
+RUN sed -i "s/disable_tls_validation: false/disable_tls_validation: true/g" dendrite.yaml
+RUN ./generate-keys --private-key matrix_key.pem --tls-cert server.crt --tls-key server.key
+
+ENV SERVER_NAME=localhost
+EXPOSE 8008 8448
+
+CMD sed -i "s/server_name: localhost/server_name: ${SERVER_NAME}/g" dendrite.yaml && ./dendrite-monolith-server --tls-cert server.crt --tls-key server.key --config dendrite.yaml