Files
mautrix-whatsapp-cloudron/Dockerfile.cloudron
2025-06-16 11:44:45 -06:00

44 lines
1.2 KiB
Docker

FROM cloudron/base:5.0.0@sha256:04fd70dbd8ad6149c19de39e35718e024417c3e01dc9c6637eaf4a41ec4e596c
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
netcat-openbsd \
bash \
jq \
yq \
git \
build-essential \
libolm-dev \
gosu \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Go
ENV GO_VERSION=1.21.4
RUN curl -LO https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
&& rm go${GO_VERSION}.linux-amd64.tar.gz
ENV PATH="/usr/local/go/bin:$PATH"
# Create app directories
RUN mkdir -p /app/code /app/pkg /app/data
WORKDIR /app/code
# Download and build mautrix-whatsapp
RUN git clone https://github.com/mautrix/whatsapp.git . \
&& go build -o /app/pkg/mautrix-whatsapp ./cmd/mautrix-whatsapp
# Copy startup script
COPY start.sh /app/pkg/
# Set volumes and environment
VOLUME /app/data
ENV UID=1337 GID=1337
# Add health check endpoint - check if the appservice port is responding
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s --retries=3 \
CMD nc -z localhost 29318 || exit 1
CMD ["/app/pkg/start.sh"]