2020-09-17 10:50:37 +00:00
|
|
|
FROM valkum/docker-rust-ci:latest as builder
|
2020-09-17 19:11:18 +00:00
|
|
|
WORKDIR /workdir
|
2020-09-16 17:53:27 +00:00
|
|
|
|
2020-09-17 10:50:37 +00:00
|
|
|
ARG RUSTC_WRAPPER
|
|
|
|
ARG AWS_ACCESS_KEY_ID
|
|
|
|
ARG AWS_SECRET_ACCESS_KEY
|
|
|
|
ARG SCCACHE_BUCKET
|
|
|
|
ARG SCCACHE_ENDPOINT
|
|
|
|
ARG SCCACHE_S3_USE_SSL
|
|
|
|
|
2020-09-16 17:53:27 +00:00
|
|
|
COPY . .
|
|
|
|
RUN cargo build
|
|
|
|
|
2020-09-17 10:50:37 +00:00
|
|
|
FROM valkum/docker-rust-ci:latest
|
2020-09-17 19:11:18 +00:00
|
|
|
WORKDIR /workdir
|
2020-09-17 13:36:36 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-09-17 19:11:18 +00:00
|
|
|
COPY --from=builder /workdir/target/debug/conduit /workdir/conduit
|
2020-09-17 10:50:37 +00:00
|
|
|
|
2020-09-17 13:36:36 +00:00
|
|
|
COPY Rocket-example.toml Rocket.toml
|
2020-09-17 19:11:18 +00:00
|
|
|
|
|
|
|
ENV SERVER_NAME=localhost
|
|
|
|
|
|
|
|
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
|
2020-09-16 17:53:27 +00:00
|
|
|
|
2020-09-17 13:36:36 +00:00
|
|
|
EXPOSE 8008 8448
|
2020-09-17 19:11:18 +00:00
|
|
|
CMD /workdir/caddy reverse-proxy --from ${SERVER_NAME}:8448 --to localhost:8008 > /dev/null 2>&1 & /workdir/conduit
|