2024-06-21 09:29:33 +02:00
|
|
|
FROM rust:1.79.0
|
2022-10-17 18:41:45 +02:00
|
|
|
|
|
|
|
WORKDIR /workdir
|
|
|
|
|
2023-12-24 09:51:26 +01:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
libclang-dev
|
2022-10-17 18:41:45 +02:00
|
|
|
|
2023-12-24 09:51:26 +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
|
2023-12-24 09:51:26 +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
|
|
|
|
RUN echo "log = \"warn,_=off,sled=off\"" >> conduit.toml
|
|
|
|
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
|