deployment edits

This commit is contained in:
Ivan I. Ovchinnikov
2026-11-23 18:45:05 +03:00
parent 0368d42c1f
commit 84fdb0a8e6
3 changed files with 23 additions and 8 deletions
+5 -1
View File
@@ -6,6 +6,7 @@ FROM ${RUST_BUILDER_IMAGE} AS builder
# Corporate CA so cargo trusts nexus.local over HTTPS.
COPY docker/certs/corporate-ca.crt /usr/local/share/ca-certificates/corporate-ca.crt
RUN update-ca-certificates
RUN apt install -y curl
WORKDIR /build
@@ -30,7 +31,10 @@ COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
USER mmbridge
# NOTE: Intentionally no `USER mmbridge` here. The entrypoint runs as root,
# fixes /data ownership, then drops privileges via runuser(1).
# This avoids "Permission denied" on bind-mounted volumes whose host-side
# ownership does not match UID 10001.
ENV MM_BRIDGE_LISTEN=0.0.0.0:8765
ENV MM_WEB_LISTEN=0.0.0.0:8766
+7 -3
View File
@@ -5,15 +5,19 @@ export MM_BRIDGE_LISTEN="${MM_BRIDGE_LISTEN:-0.0.0.0:8765}"
export MM_WEB_LISTEN="${MM_WEB_LISTEN:-0.0.0.0:8766}"
export MM_DATA_DIR="${MM_DATA_DIR:-/data}"
# Ensure data directory exists with correct ownership.
# Entrypoint runs as root; we fix permissions then drop to mmbridge below.
mkdir -p "${MM_DATA_DIR}"
chown -R mmbridge:mmbridge "${MM_DATA_DIR}" 2>/dev/null || true
# Drop privileges to the unprivileged mmbridge user.
if [[ "$#" -eq 0 ]]; then
exec mm-bridge
exec runuser -u mmbridge -- mm-bridge
fi
if [[ "$1" == "mm-bridge" ]]; then
shift
exec mm-bridge "$@"
exec runuser -u mmbridge -- mm-bridge "$@"
fi
exec "$@"
exec runuser -u mmbridge -- "$@"