2024-01-29 00:53:27 +01:00
|
|
|
FROM rust:1.75.0
|
2022-10-17 18:41:45 +02:00
|
|
|
|
|
|
|
WORKDIR /workdir
|
|
|
|
|
2024-01-29 00:53:27 +01:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
libclang-dev
|
2022-10-17 18:41:45 +02:00
|
|
|
|
2024-01-29 00:53:27 +01:00
|
|
|
COPY Cargo.toml Cargo.toml
|
|
|
|
COPY Cargo.lock Cargo.lock
|
|
|
|
COPY src src
|
|
|
|
RUN cargo build --release \
|
|
|
|
&& mv target/release/conduit conduit \
|
|
|
|
&& rm -rf target
|
2022-10-17 18:41:45 +02:00
|
|
|
|
|
|
|
# Install caddy
|
2024-01-29 00:53:27 +01:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y \
|
|
|
|
debian-keyring \
|
|
|
|
debian-archive-keyring \
|
|
|
|
apt-transport-https \
|
|
|
|
curl \
|
|
|
|
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/testing/gpg.key' \
|
|
|
|
| gpg --dearmor -o /usr/share/keyrings/caddy-testing-archive-keyring.gpg \
|
|
|
|
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/testing/debian.deb.txt' \
|
|
|
|
| tee /etc/apt/sources.list.d/caddy-testing.list \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install -y caddy
|
2022-10-17 18:41:45 +02:00
|
|
|
|
|
|
|
COPY conduit-example.toml conduit.toml
|
|
|
|
COPY complement/caddy.json caddy.json
|
|
|
|
|
|
|
|
ENV SERVER_NAME=localhost
|
|
|
|
ENV CONDUIT_CONFIG=/workdir/conduit.toml
|
|
|
|
|
|
|
|
RUN sed -i "s/port = 6167/port = 8008/g" conduit.toml
|
2024-01-29 00:53:27 +01:00
|
|
|
RUN echo "log = \"warn,_=off,sled=off\"" >> conduit.toml
|
2022-10-17 18:41:45 +02:00
|
|
|
RUN sed -i "s/address = \"127.0.0.1\"/address = \"0.0.0.0\"/g" conduit.toml
|
|
|
|
|
|
|
|
EXPOSE 8008 8448
|
|
|
|
|
|
|
|
CMD uname -a && \
|
|
|
|
sed -i "s/#server_name = \"your.server.name\"/server_name = \"${SERVER_NAME}\"/g" conduit.toml && \
|
|
|
|
sed -i "s/your.server.name/${SERVER_NAME}/g" caddy.json && \
|
|
|
|
caddy start --config caddy.json > /dev/null && \
|
|
|
|
/workdir/conduit
|
2024-01-29 00:53:27 +01:00
|
|
|
|