Files
AstralTech-Docker-Images/Stalwart/Dockerfile.stalwart

32 lines
1.4 KiB
Docker

FROM ubuntu:22.04
# Update and Upgrade Ubuntu -> install dependencies
RUN apt-get update && apt-get upgrade -y
RUN apt-get install curl wget git cargo build-essential clang libclang-dev -y
# Download and install FoundationDB client library
RUN wget https://github.com/apple/foundationdb/releases/download/7.3.63/foundationdb-clients_7.3.63-1_amd64.deb
RUN dpkg -i foundationdb-clients_7.3.63-1_amd64.deb
# Download Rust and setup Cargo for build
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Build and run stalwart with RocksDB, FoundationDB, S3, Elastic, and Redis features
RUN git clone https://github.com/stalwartlabs/stalwart.git stalwart-build
WORKDIR /stalwart-build
RUN git tag --sort=-version:refname | head -1
RUN git checkout tags/$(git tag --sort=-version:refname | head -1)
RUN cargo build --release -p stalwart --no-default-features --features "rocks foundationdb s3 elastic redis"
RUN cp target/release/stalwart /usr/local/bin/stalwart
# Expose the ports for Stalwart
EXPOSE 443 8080 25 587 465 143 993 4190 110 995
# Change the Directory of the server to be in the stalwart install directory
WORKDIR /opt/stalwart
# Copy and run Entrypoint file
COPY ./resources/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]