73 Star 768 Fork 197

思源笔记/siyuan

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
88250 提交于 2025-11-21 19:41 +08:00 . :art:docker image golang 1.25
FROM --platform=$BUILDPLATFORM node:21 AS node-build
ARG NPM_REGISTRY=
WORKDIR /app
ADD app/package.json app/pnpm* app/.npmrc .
RUN <<EORUN
#!/bin/bash -e
corepack enable
corepack install --global $(node -e 'console.log(require("./package.json").packageManager)')
npm config set registry ${NPM_REGISTRY}
pnpm install --silent
EORUN
ADD app/ .
RUN <<EORUN
#!/bin/bash -e
pnpm run build
mkdir /artifacts
mv appearance stage guide changelogs /artifacts/
EORUN
FROM golang:1.25-alpine AS go-build
RUN <<EORUN
#!/bin/sh -e
apk add --no-cache gcc musl-dev
go env -w GO111MODULE=on
go env -w CGO_ENABLED=1
EORUN
WORKDIR /kernel
ADD 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:latest
LABEL maintainer="Liang Ding<845765@qq.com>"
RUN apk add --no-cache ca-certificates tzdata su-exec
ENV TZ=Asia/Shanghai
ENV HOME=/home/siyuan
ENV RUN_IN_CONTAINER=true
EXPOSE 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"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/siyuan-note/siyuan.git
git@gitee.com:siyuan-note/siyuan.git
siyuan-note
siyuan
siyuan
master

搜索帮助