FROM ubuntu:24.04

RUN apt-get update && apt-get install -y \
    redis-tools \
    curl \
    ca-certificates \
    libluajit-5.1-2 \
    libglib2.0-0 \
    libssl3 \
    libicu74 \
    libsodium23 \
    libhyperscan5 \
    libpcre2-8-0 \
    libjemalloc2 \
    libmagic1 \
    libarchive13 \
    libzstd1 \
    libbrotli1 \
    libfann2 \
    libstemmer0d \
    libasan8 \
    libsqlite3-0 \
    libunwind8 \
    && rm -rf /var/lib/apt/lists/*

COPY install/usr /usr
COPY install/etc /etc

RUN mkdir -p /var/lib/rspamd /var/log/rspamd /var/run/rspamd && \
    echo "/usr/lib/rspamd" > /etc/ld.so.conf.d/rspamd.conf && \
    ldconfig

EXPOSE 11333 11334 11335

CMD ["/usr/bin/rspamd", "-f", "-c", "/etc/rspamd/rspamd.conf", "--insecure"]
