fix: use debian base and wget for stalwart
Build Stalwart Mail Yolk / build (push) Failing after 13m20s
Build Stalwart Mail Yolk / build (push) Failing after 13m20s
This commit is contained in:
+25
-11
@@ -1,4 +1,4 @@
|
||||
FROM ghcr.io/stalwartlabs/mail-server:latest
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
LABEL author="RefoselTeam" maintainer="admin@refoseltw.ru"
|
||||
|
||||
@@ -7,27 +7,41 @@ LABEL org.opencontainers.image.licenses=MIT
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install additional tools
|
||||
RUN apt update \
|
||||
&& apt upgrade -y \
|
||||
&& apt install -y \
|
||||
# Install dependencies
|
||||
RUN apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get install -y \
|
||||
ca-certificates \
|
||||
curl \
|
||||
git \
|
||||
tini \
|
||||
&& apt clean \
|
||||
wget \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create directories
|
||||
RUN mkdir -p /home/container/stalwart-mail/data \
|
||||
&& mkdir -p /home/container/stalwart-mail/certs \
|
||||
&& mkdir -p /home/container/stalwart-mail/logs
|
||||
# Create directories first
|
||||
RUN mkdir -p /opt/stalwart-mail/bin \
|
||||
&& mkdir -p /opt/stalwart-mail/etc \
|
||||
&& mkdir -p /opt/stalwart-mail/data \
|
||||
&& mkdir -p /opt/stalwart-mail/logs
|
||||
|
||||
# Download and install Stalwart Mail Server
|
||||
ARG STALWART_VERSION=0.16.8
|
||||
RUN wget -q -O /tmp/stalwart.tar.gz \
|
||||
"https://github.com/stalwartlabs/stalwart/releases/download/v${STALWART_VERSION}/stalwart-x86_64-unknown-linux-gnu.tar.gz" \
|
||||
&& tar -xzf /tmp/stalwart.tar.gz -C /tmp/ \
|
||||
&& ls -la /tmp/ \
|
||||
&& find /tmp -maxdepth 2 -name "stalwart*" \
|
||||
&& cp /tmp/stalwart /opt/stalwart-mail/bin/stalwart-mail \
|
||||
&& chmod +x /opt/stalwart-mail/bin/stalwart-mail \
|
||||
&& rm -rf /tmp/*
|
||||
|
||||
EXPOSE 8080 465 587 993 995 4190
|
||||
|
||||
STOPSIGNAL SIGINT
|
||||
|
||||
COPY --chown=root:root ./entrypoint.sh /entrypoint.sh
|
||||
COPY --chown=root:root ./config.toml /entrypoint-config.toml
|
||||
COPY --chown=root:root ./config.toml /opt/stalwart-mail/etc/config.toml
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
|
||||
|
||||
@@ -11,13 +11,14 @@ export TZ
|
||||
cd /home/container || exit 1
|
||||
|
||||
# Stalwart paths
|
||||
STALWART_HOME="/var/lib/stalwart-mail"
|
||||
STALWART_CONFIG="/etc/stalwart-mail/config.toml"
|
||||
STALWART_HOME="/opt/stalwart-mail"
|
||||
STALWART_CONFIG="${STALWART_HOME}/etc/config.toml"
|
||||
STALWART_BIN="${STALWART_HOME}/bin/stalwart-mail"
|
||||
|
||||
# Create config from template if not exists
|
||||
if [ ! -f "${STALWART_CONFIG}" ]; then
|
||||
echo "Generating Stalwart configuration..."
|
||||
cp /entrypoint-config.toml "${STALWART_CONFIG}"
|
||||
cp /opt/stalwart-mail/etc/config.toml "${STALWART_CONFIG}"
|
||||
|
||||
# Replace placeholders with environment variables
|
||||
sed -i "s|{{MAIL_DOMAIN}}|${MAIL_DOMAIN:-mail.example.com}|g" "${STALWART_CONFIG}"
|
||||
|
||||
Reference in New Issue
Block a user