-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (50 loc) · 1.87 KB
/
Copy pathDockerfile
File metadata and controls
66 lines (50 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# syntax=docker/dockerfile:1
# Upstream release binaries are built on ubuntu-latest (glibc 2.39).
# Debian bookworm (glibc 2.36) cannot run them.
FROM ubuntu:24.04 AS fetch
ARG MENTISDB_VERSION=0.10.4.49
ARG TARGETARCH
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
RUN set -eux; \
case "${TARGETARCH}" in \
amd64) ARCH="x86_64" ;; \
arm64) ARCH="arm64" ;; \
*) echo "unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; \
esac; \
URL="https://github.com/CloudLLM-ai/mentisdb/releases/download/${MENTISDB_VERSION}/mentisdb-linux-${ARCH}"; \
curl -fsSL -o mentisdb "${URL}"; \
chmod +x mentisdb
FROM ubuntu:24.04
LABEL org.opencontainers.image.authors="Richard Freeman <rich@rich0.org>"
LABEL org.opencontainers.image.source=https://github.com/rich0/mentisdb-contain
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
libasound2t64 \
tini \
&& rm -rf /var/lib/apt/lists/* \
&& userdel -r ubuntu 2>/dev/null || userdel ubuntu \
&& useradd --uid 1000 --home-dir /data --shell /usr/sbin/nologin --no-create-home mentisdb \
&& mkdir -p /data \
&& chown mentisdb:mentisdb /data
COPY --from=fetch /tmp/mentisdb /usr/local/bin/mentisdb
ENV MENTISDB_DIR=/data \
MENTISDB_BIND_HOST=0.0.0.0 \
MENTISDB_AUTO_FLUSH=true \
MENTISDB_UPDATE_CHECK=false \
MENTISDB_STARTUP_SOUND=false \
MENTISDB_DASHBOARD_PORT=9475 \
RUST_LOG=info
VOLUME /data
WORKDIR /data
EXPOSE 9471/tcp 9472/tcp 9473/tcp 9474/tcp 9475/tcp
USER mentisdb
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
CMD curl -fsS http://127.0.0.1:9472/health || exit 1
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["mentisdb", "--headless"]