From 009e36b68010d4b8bb42acc05c3614f8742994bd Mon Sep 17 00:00:00 2001 From: Rudi Floren Date: Thu, 17 Sep 2020 21:11:18 +0200 Subject: [PATCH] Fix Caddy integration for reverse-proxy --- tests/Complement.Dockerfile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/Complement.Dockerfile b/tests/Complement.Dockerfile index 10a33d7..f32f878 100644 --- a/tests/Complement.Dockerfile +++ b/tests/Complement.Dockerfile @@ -1,5 +1,5 @@ FROM valkum/docker-rust-ci:latest as builder -WORKDIR /build +WORKDIR /workdir ARG RUSTC_WRAPPER ARG AWS_ACCESS_KEY_ID @@ -12,17 +12,19 @@ COPY . . RUN cargo build FROM valkum/docker-rust-ci:latest -WORKDIR /build +WORKDIR /workdir RUN curl -OL "https://github.com/caddyserver/caddy/releases/download/v2.1.1/caddy_2.1.1_linux_amd64.tar.gz" RUN tar xzf caddy_2.1.1_linux_amd64.tar.gz -COPY --from=builder /build/target/debug/conduit /conduit +COPY --from=builder /workdir/target/debug/conduit /workdir/conduit + +COPY Rocket-example.toml Rocket.toml ENV SERVER_NAME=localhost -COPY Rocket-example.toml Rocket.toml -RUN sed -i "s/server_name: your.server.name/server_name: ${SERVER_NAME}/g" Rocket.toml -RUN sed -i "s/port = 14004/port: 8008/g" Rocket.toml + +RUN sed -i "s/server_name = \"your.server.name\"/server_name = \"${SERVER_NAME}\"/g" Rocket.toml +RUN sed -i "s/port = 14004/port = 8008/g" Rocket.toml EXPOSE 8008 8448 -CMD caddy --from 8448 --to localhost:8008 & && /conduit \ No newline at end of file +CMD /workdir/caddy reverse-proxy --from ${SERVER_NAME}:8448 --to localhost:8008 > /dev/null 2>&1 & /workdir/conduit \ No newline at end of file