2020-09-17 13:50:37 +03:00
|
|
|
FROM valkum/docker-rust-ci:latest as builder
|
2020-09-16 20:53:27 +03:00
|
|
|
WORKDIR /build
|
|
|
|
|
2020-09-17 13:50:37 +03: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 20:53:27 +03:00
|
|
|
COPY . .
|
|
|
|
RUN cargo build
|
|
|
|
|
2020-09-17 13:50:37 +03:00
|
|
|
FROM valkum/docker-rust-ci:latest
|
|
|
|
WORKDIR /build
|
2020-09-17 16:36:36 +03: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 13:50:37 +03:00
|
|
|
COPY --from=builder /build/target/debug/conduit /conduit
|
|
|
|
|
2020-09-16 20:53:27 +03:00
|
|
|
ENV SERVER_NAME=localhost
|
2020-09-17 16:36:36 +03:00
|
|
|
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
|
2020-09-16 20:53:27 +03:00
|
|
|
|
2020-09-17 16:36:36 +03:00
|
|
|
EXPOSE 8008 8448
|
|
|
|
CMD caddy --from 8448 --to localhost:8008 & && /conduit
|