mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-30 05:02:31 +00:00
cf8f1f2546
Well, kinda. It crashed on me after 10 minutes because the tests timed out like in <https://github.com/matrix-org/complement/issues/394>. Sounds like this means it's a them problem though. I want to use Nix to build this image instead in the future but this will at least make it work for now and give me a reference for while I'm porting it. I also want to make Conduit natively understand Complement's requirements instead of `sed`ing a bunch of stuff and needing a reverse proxy in the container. Should be more reliable that way. I'm not making this run in CI until the above stuff is addressed and until I can decide on a way to pin the revision of Complement being tested against.
46 lines
1.4 KiB
Docker
46 lines
1.4 KiB
Docker
FROM rust:1.75.0
|
|
|
|
WORKDIR /workdir
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libclang-dev
|
|
|
|
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
|
|
|
|
# Install caddy
|
|
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
|
|
|
|
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
|