Files
mostlymatter/temp
2026-02-07 17:05:08 +00:00

55 lines
1.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ---- Stage 1: Fetch Mattermost + MostlyMatter ----
FROM debian:bookworm-slim AS fetcher
ARG MOSTLYMATTER_VERSION=v11.3.0
ARG MATTERMOST_VERSION=11.3.0
ARG MM_DOWNLOAD_URL=http://85.113.221.90:8000/mattermost-11.3.0-linux-amd64.tar.gz
ARG MOSTLY_DOWNLOAD_URL=http://85.113.221.90:8000/mostlymatter-amd64-v11.3.0
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates tar \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
# Сначала меняем владельца в fetcher stage
RUN curl -L $MM_DOWNLOAD_URL | tar -xz && \
chown -R 2000:2000 /tmp/mattermost
# Загружаем MostlyMatter
RUN curl -L -o /tmp/mostlymatter $MOSTLY_DOWNLOAD_URL && \
chmod +x /tmp/mostlymatter && \
mv /tmp/mostlymatter /tmp/mattermost/bin/ && \
chown 2000:2000 /tmp/mattermost/bin/mostlymatter
# ---- Stage 2: Runtime container ----
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates tzdata curl \
&& rm -rf /var/lib/apt/lists/*
# Создаем пользователя с тем же UID
RUN groupadd -g 2000 mattermost && \
useradd -u 2000 -g mattermost -s /bin/bash -d /mattermost -m mattermost
WORKDIR /mattermost
# Копируем с сохранением прав
COPY --from=fetcher --chown=2000:2000 /tmp/mattermost /mattermost/
# Создаем директории (быстро, так как их мало)
RUN mkdir -p config data logs plugins client/plugins && \
chown -R mattermost:mattermost config data logs plugins client/plugins
VOLUME ["/mattermost/config", "/mattermost/data", "/mattermost/logs", "/mattermost/plugins", "/mattermost/client/plugins"]
USER mattermost
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD curl -f http://localhost:8065/api/v4/system/ping || exit 1
EXPOSE 8065
ENTRYPOINT ["/mattermost/bin/mostlymatter"]
CMD ["server"]