Something went wrong. Try again.
A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)
Something went wrong. Try again.
siyuan Dockerfile
1.3 kB · 57 lines
Dockerfile
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758FROM --platform=$BUILDPLATFORM node:21 AS node-build
ARG NPM_REGISTRY=
WORKDIR /appADD app/package.json app/pnpm* app/.npmrc .
RUN <<EORUN#!/bin/bash -ecorepack enablecorepack install --global $(node -e 'console.log(require("./package.json").packageManager)')npm config set registry ${NPM_REGISTRY}pnpm install --silentEORUN
ADD app/ .RUN <<EORUN#!/bin/bash -epnpm run buildmkdir /artifactsmv appearance stage guide changelogs /artifacts/EORUN
FROM golang:1.25-alpine AS go-build
RUN <<EORUN#!/bin/sh -eapk add --no-cache gcc musl-devgo env -w GO111MODULE=ongo env -w CGO_ENABLED=1EORUN
WORKDIR /kernelADD kernel/go.* .RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg \ go mod download
ADD kernel/ .RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg \ go build --tags fts5 -v -ldflags "-s -w"
FROM alpine:latestLABEL maintainer="Liang Ding<845765@qq.com>"
RUN apk add --no-cache ca-certificates tzdata su-exec
ENV TZ=Asia/ShanghaiENV HOME=/home/siyuanENV RUN_IN_CONTAINER=trueEXPOSE 6806
WORKDIR /opt/siyuan/COPY --from=go-build --chmod=755 /kernel/kernel /kernel/entrypoint.sh .COPY --from=node-build /artifacts .
ENTRYPOINT ["/opt/siyuan/entrypoint.sh"]CMD ["/opt/siyuan/kernel"]