mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
fix os.version shim, improve docker image
This commit is contained in:
48
Dockerfile
48
Dockerfile
@@ -1,12 +1,6 @@
|
||||
# Build shim-loader.js
|
||||
FROM node:20-slim AS build
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
curl \
|
||||
binutils \
|
||||
xz-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
@@ -14,49 +8,37 @@ RUN npm ci --ignore-scripts
|
||||
|
||||
COPY build.js ./
|
||||
COPY shims/ ./shims/
|
||||
COPY scripts/ ./scripts/
|
||||
COPY server/ ./server/
|
||||
|
||||
RUN npm run build:shims
|
||||
|
||||
|
||||
ARG OBSIDIAN_VERSION=1.8.9
|
||||
RUN curl -fSL "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian_${OBSIDIAN_VERSION}_amd64.deb" \
|
||||
-o /tmp/obsidian.deb \
|
||||
&& mkdir -p /tmp/obsidian-deb \
|
||||
&& ar x /tmp/obsidian.deb --output=/tmp/obsidian-deb \
|
||||
&& mkdir -p /tmp/obsidian-pkg \
|
||||
&& tar -xf /tmp/obsidian-deb/data.tar.xz -C /tmp/obsidian-pkg \
|
||||
&& rm -rf /tmp/obsidian.deb /tmp/obsidian-deb
|
||||
|
||||
|
||||
RUN npx --yes @electron/asar extract \
|
||||
/tmp/obsidian-pkg/opt/Obsidian/resources/obsidian.asar \
|
||||
/build/obsidian-app \
|
||||
&& rm -rf /tmp/obsidian-pkg
|
||||
|
||||
# Patch index.html
|
||||
RUN node scripts/patch-obsidian.js /build/obsidian-app
|
||||
|
||||
RUN cp dist/shim-loader.js /build/obsidian-app/shim-loader.js
|
||||
|
||||
# Production image
|
||||
# Production image. No Obsidian code included.
|
||||
# On first run, the entrypoint downloads and patches Obsidian.
|
||||
FROM node:20-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl binutils xz-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev --ignore-scripts
|
||||
|
||||
COPY server/ ./server/
|
||||
COPY --from=build /build/obsidian-app ./obsidian-app
|
||||
COPY scripts/ ./scripts/
|
||||
COPY images/ ./images/
|
||||
COPY --from=build /build/dist ./dist
|
||||
|
||||
RUN chmod +x /app/scripts/entrypoint.sh
|
||||
|
||||
ENV PORT=8080
|
||||
ENV VAULT_ROOT=/vaults
|
||||
ENV OBSIDIAN_VERSION=1.8.9
|
||||
ENV OBSIDIAN_ASSETS_PATH=/app/obsidian-app
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
VOLUME /vaults
|
||||
VOLUME /app/obsidian-app
|
||||
|
||||
CMD ["node", "server/index.js"]
|
||||
ENTRYPOINT ["/app/scripts/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user