diff options
Diffstat (limited to 'build/scripts')
-rw-r--r-- | build/scripts/Complement.Dockerfile | 8 | ||||
-rw-r--r-- | build/scripts/ComplementLocal.Dockerfile | 28 | ||||
-rw-r--r-- | build/scripts/ComplementPostgres.Dockerfile | 34 |
3 files changed, 35 insertions, 35 deletions
diff --git a/build/scripts/Complement.Dockerfile b/build/scripts/Complement.Dockerfile index 63e3890e..56877051 100644 --- a/build/scripts/Complement.Dockerfile +++ b/build/scripts/Complement.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16-stretch as build +FROM golang:1.18-stretch as build RUN apt-get update && apt-get install -y sqlite3 WORKDIR /build @@ -27,6 +27,6 @@ EXPOSE 8008 8448 # At runtime, generate TLS cert based on the CA now mounted at /ca # At runtime, replace the SERVER_NAME with what we are told CMD ./generate-keys --server $SERVER_NAME --tls-cert server.crt --tls-key server.key --tls-authority-cert /complement/ca/ca.crt --tls-authority-key /complement/ca/ca.key && \ - ./generate-config -server $SERVER_NAME --ci > dendrite.yaml && \ - cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates && \ - ./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml -api=${API:-0} + ./generate-config -server $SERVER_NAME --ci > dendrite.yaml && \ + cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates && \ + ./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml -api=${API:-0} diff --git a/build/scripts/ComplementLocal.Dockerfile b/build/scripts/ComplementLocal.Dockerfile index a9feb4cd..704359a2 100644 --- a/build/scripts/ComplementLocal.Dockerfile +++ b/build/scripts/ComplementLocal.Dockerfile @@ -6,7 +6,7 @@ # # Use these mounts to make use of this dockerfile: # COMPLEMENT_HOST_MOUNTS='/your/local/dendrite:/dendrite:ro;/your/go/path:/go:ro' -FROM golang:1.16-stretch +FROM golang:1.18-stretch RUN apt-get update && apt-get install -y sqlite3 WORKDIR /runtime @@ -16,24 +16,24 @@ EXPOSE 8008 8448 # This script compiles Dendrite for us. RUN echo '\ -#!/bin/bash -eux \n\ -if test -f "/runtime/dendrite-monolith-server"; then \n\ + #!/bin/bash -eux \n\ + if test -f "/runtime/dendrite-monolith-server"; then \n\ echo "Skipping compilation; binaries exist" \n\ exit 0 \n\ -fi \n\ -cd /dendrite \n\ -go build -v -o /runtime /dendrite/cmd/dendrite-monolith-server \n\ -' > compile.sh && chmod +x compile.sh + fi \n\ + cd /dendrite \n\ + go build -v -o /runtime /dendrite/cmd/dendrite-monolith-server \n\ + ' > compile.sh && chmod +x compile.sh # This script runs Dendrite for us. Must be run in the /runtime directory. RUN echo '\ -#!/bin/bash -eu \n\ -./generate-keys --private-key matrix_key.pem \n\ -./generate-keys --server $SERVER_NAME --tls-cert server.crt --tls-key server.key --tls-authority-cert /complement/ca/ca.crt --tls-authority-key /complement/ca/ca.key \n\ -./generate-config -server $SERVER_NAME --ci > dendrite.yaml \n\ -cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates \n\ -./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml \n\ -' > run.sh && chmod +x run.sh + #!/bin/bash -eu \n\ + ./generate-keys --private-key matrix_key.pem \n\ + ./generate-keys --server $SERVER_NAME --tls-cert server.crt --tls-key server.key --tls-authority-cert /complement/ca/ca.crt --tls-authority-key /complement/ca/ca.key \n\ + ./generate-config -server $SERVER_NAME --ci > dendrite.yaml \n\ + cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates \n\ + ./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml \n\ + ' > run.sh && chmod +x run.sh WORKDIR /cache diff --git a/build/scripts/ComplementPostgres.Dockerfile b/build/scripts/ComplementPostgres.Dockerfile index 4e26faa5..a8b4fbb1 100644 --- a/build/scripts/ComplementPostgres.Dockerfile +++ b/build/scripts/ComplementPostgres.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16-stretch as build +FROM golang:1.18-stretch as build RUN apt-get update && apt-get install -y postgresql WORKDIR /build @@ -9,16 +9,16 @@ RUN sed -i "s%127.0.0.1/32 md5%127.0.0.1/32 trust%g" /etc/ # This entry script starts postgres, waits for it to be up then starts dendrite RUN echo '\ -#!/bin/bash -eu \n\ -pg_lsclusters \n\ -pg_ctlcluster 9.6 main start \n\ - \n\ -until pg_isready \n\ -do \n\ - echo "Waiting for postgres"; \n\ - sleep 1; \n\ -done \n\ -' > run_postgres.sh && chmod +x run_postgres.sh + #!/bin/bash -eu \n\ + pg_lsclusters \n\ + pg_ctlcluster 9.6 main start \n\ + \n\ + until pg_isready \n\ + do \n\ + echo "Waiting for postgres"; \n\ + sleep 1; \n\ + done \n\ + ' > run_postgres.sh && chmod +x run_postgres.sh # we will dump the binaries and config file to this location to ensure any local untracked files # that come from the COPY . . file don't contaminate the build @@ -46,9 +46,9 @@ EXPOSE 8008 8448 # At runtime, generate TLS cert based on the CA now mounted at /ca # At runtime, replace the SERVER_NAME with what we are told CMD /build/run_postgres.sh && ./generate-keys --server $SERVER_NAME --tls-cert server.crt --tls-key server.key --tls-authority-cert /complement/ca/ca.crt --tls-authority-key /complement/ca/ca.key && \ - ./generate-config -server $SERVER_NAME --ci > dendrite.yaml && \ - # Replace the connection string with a single postgres DB, using user/db = 'postgres' and no password, bump max_conns - sed -i "s%connection_string:.*$%connection_string: postgresql://postgres@localhost/postgres?sslmode=disable%g" dendrite.yaml && \ - sed -i 's/max_open_conns:.*$/max_open_conns: 100/g' dendrite.yaml && \ - cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates && \ - ./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml -api=${API:-0}
\ No newline at end of file + ./generate-config -server $SERVER_NAME --ci > dendrite.yaml && \ + # Replace the connection string with a single postgres DB, using user/db = 'postgres' and no password, bump max_conns + sed -i "s%connection_string:.*$%connection_string: postgresql://postgres@localhost/postgres?sslmode=disable%g" dendrite.yaml && \ + sed -i 's/max_open_conns:.*$/max_open_conns: 100/g' dendrite.yaml && \ + cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates && \ + ./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml -api=${API:-0}
\ No newline at end of file |