Files
ignis/apps/ignis-server/Dockerfile

73 lines
2.5 KiB
Docker
Raw Normal View History

2026-05-22 15:15:07 +02:00
# Build stage.
# Runs from the repo root as build context so workspace symlinks resolve.
# Copies workspace package.jsons first for cache-friendly npm ci.
FROM node:22-slim AS build
2026-03-10 21:07:19 +01:00
2026-05-22 15:15:07 +02:00
WORKDIR /app
2026-03-10 21:07:19 +01:00
COPY package.json package-lock.json ./
2026-05-22 15:15:07 +02:00
COPY packages/services/package.json ./packages/services/
COPY packages/shim/package.json ./packages/shim/
COPY packages/ui/package.json ./packages/ui/
2026-05-24 00:26:32 +02:00
COPY packages/bridge/package.json ./packages/bridge/
2026-05-22 15:15:07 +02:00
COPY packages/server-core/package.json ./packages/server-core/
COPY apps/ignis-server/package.json ./apps/ignis-server/
2026-03-10 21:07:19 +01:00
RUN npm ci --ignore-scripts
COPY build.js ./
2026-05-22 15:15:07 +02:00
COPY packages/ ./packages/
COPY apps/ignis-server/ ./apps/ignis-server/
2026-03-10 21:07:19 +01:00
2026-03-19 15:37:47 +01:00
RUN npm run build
2026-03-10 21:07:19 +01:00
# Production image. No Obsidian code included.
2026-04-05 22:32:23 +02:00
# On first run, the entrypoint downloads Obsidian.
FROM node:22-slim
2026-03-10 21:07:19 +01:00
LABEL com.thiefling.ignis.obsidian-version="1.12.7"
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl gosu \
&& rm -rf /var/lib/apt/lists/*
2026-03-10 21:07:19 +01:00
WORKDIR /app
2026-05-22 15:15:07 +02:00
# Workspace package.jsons + lockfile so npm ci sets up the @ignis/* symlinks.
2026-03-10 21:07:19 +01:00
COPY package.json package-lock.json ./
2026-05-22 15:15:07 +02:00
COPY packages/services/package.json ./packages/services/
COPY packages/shim/package.json ./packages/shim/
COPY packages/ui/package.json ./packages/ui/
2026-05-24 00:26:32 +02:00
COPY packages/bridge/package.json ./packages/bridge/
2026-05-22 15:15:07 +02:00
COPY packages/server-core/package.json ./packages/server-core/
COPY apps/ignis-server/package.json ./apps/ignis-server/
2026-03-10 21:07:19 +01:00
RUN npm ci --omit=dev --ignore-scripts
2026-05-22 15:15:07 +02:00
# Runtime sources: the server, entrypoint script, repo-rooted images, and the server-core JS that gets required from the server at runtime.
COPY apps/ignis-server/server/ ./apps/ignis-server/server/
COPY apps/ignis-server/scripts/ ./apps/ignis-server/scripts/
COPY images/ ./images/
2026-05-22 15:15:07 +02:00
COPY packages/server-core/src/ ./packages/server-core/src/
# Built artifacts from the build stage.
COPY --from=build /app/packages/shim/dist/shim-loader.js ./packages/shim/dist/shim-loader.js
COPY --from=build /app/packages/ui/dist/ignis-ui.js ./packages/ui/dist/ignis-ui.js
COPY --from=build /app/apps/ignis-server/server/plugins/headless-sync/obsidian/dist/ ./apps/ignis-server/server/plugins/headless-sync/obsidian/dist/
2026-05-22 15:15:07 +02:00
RUN chmod +x /app/apps/ignis-server/scripts/entrypoint.sh
2026-03-10 21:07:19 +01:00
ENV PORT=8080
2026-03-11 23:17:53 +01:00
ENV VAULT_ROOT=/vaults
ENV OBSIDIAN_VERSION=1.12.7
2026-03-10 21:07:19 +01:00
ENV OBSIDIAN_ASSETS_PATH=/app/obsidian-app
2026-03-21 00:34:52 +01:00
ENV PUID=1000
ENV PGID=1000
2026-03-10 21:07:19 +01:00
EXPOSE 8080
2026-03-11 23:17:53 +01:00
VOLUME /vaults
VOLUME /app/obsidian-app
2026-03-10 21:07:19 +01:00
2026-05-22 15:15:07 +02:00
ENTRYPOINT ["/app/apps/ignis-server/scripts/entrypoint.sh"]