902a3df8b5
Build and Push Docker Container / build-and-push (push) Successful in 4m26s
- Add Docker image for the official Obsidian desktop app and CLI. - Start Obsidian headlessly with Xvfb and DBus setup. - Expose a safe structured HTTP command API without shell execution. - Add JWT-based vault, path, and command authorization. - Support single-vault and multi-vault container mounts. - Add TypeScript SDK helpers for Obsidian CLI commands. - Add n8n community node package with Obsidian operations. - Add docs, compose config, tests, and production image workflow.
68 lines
1.9 KiB
Docker
68 lines
1.9 KiB
Docker
FROM ghcr.io/astral-sh/uv:python3.14-bookworm-slim
|
|
|
|
ARG OBSIDIAN_VERSION=1.12.7
|
|
ARG TARGETARCH
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
UV_COMPILE_BYTECODE=1 \
|
|
UV_LINK_MODE=copy \
|
|
PATH="/app/.venv/bin:/usr/local/bin:${PATH}" \
|
|
OBSIDIAN_CLI_BIN=obsidian \
|
|
OBSIDIAN_VAULT_PATH=/vault \
|
|
OBSIDIAN_API_HOST=0.0.0.0 \
|
|
OBSIDIAN_API_PORT=8080 \
|
|
DISPLAY=:99 \
|
|
XDG_RUNTIME_DIR=/tmp/runtime-obsidian \
|
|
ELECTRON_DISABLE_SECURITY_WARNINGS=true
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
dumb-init \
|
|
xvfb \
|
|
xauth \
|
|
dbus-x11 \
|
|
libasound2 \
|
|
libatk-bridge2.0-0 \
|
|
libatk1.0-0 \
|
|
libatspi2.0-0 \
|
|
libcairo2 \
|
|
libcups2 \
|
|
libdbus-1-3 \
|
|
libdrm2 \
|
|
libgbm1 \
|
|
libgtk-3-0 \
|
|
libnss3 \
|
|
libpango-1.0-0 \
|
|
libx11-xcb1 \
|
|
libxcb-dri3-0 \
|
|
libxcomposite1 \
|
|
libxdamage1 \
|
|
libxfixes3 \
|
|
libxkbcommon0 \
|
|
libxrandr2 \
|
|
&& case "${TARGETARCH:-amd64}" in \
|
|
amd64) OBSIDIAN_DEB_ARCH=amd64 ;; \
|
|
arm64) OBSIDIAN_DEB_ARCH=arm64 ;; \
|
|
*) echo "Unsupported architecture: ${TARGETARCH}" >&2; exit 1 ;; \
|
|
esac \
|
|
&& curl -fsSL -o /tmp/obsidian.deb "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian_${OBSIDIAN_VERSION}_${OBSIDIAN_DEB_ARCH}.deb" \
|
|
&& apt-get install -y --no-install-recommends /tmp/obsidian.deb \
|
|
&& ln -sf /opt/Obsidian/obsidian-cli /usr/local/bin/obsidian \
|
|
&& rm -rf /tmp/obsidian.deb /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY pyproject.toml ./
|
|
RUN uv sync --no-dev
|
|
|
|
COPY app ./app
|
|
COPY sdk ./sdk
|
|
COPY scripts ./scripts
|
|
RUN chmod +x /app/scripts/entrypoint.sh /app/scripts/create_jwt.py
|
|
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["dumb-init", "--"]
|
|
CMD ["/app/scripts/entrypoint.sh"]
|