-
|
Hello, I did some research in the discussions forum and in the documentation and sadly couldn't find any helping pointers. I want to build the server myself from source in a container and also build the container image afterwards. I did check out https://docs.triliumnotes.org/#building-the-executable and https://github.com/TriliumNext/Trilium/blob/main/docs/Developer%20Guide/Developer%20Guide/Project%20Structure.md but I couldn't get any information from there that would resolve my problem. The fixed working file: Running the Can someone give me guidance how to properly get the server built in the container? What am I missing? Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
Hi @Hetti! I'm Dosu and I’m helping the Trilium team. The main issue is likely the build order and dependency installation in your Dockerfile. In a TriliumNext monorepo, you must build all shared packages (like ckeditor5, commons, highlightjs, codemirror, share-theme) before building the server. Your Dockerfile currently skips these steps—they're commented out. This causes the server build to fail because its dependencies aren't built yet. Uncomment and run the shared package build steps before RUN pnpm run --filter "@triliumnext/ckeditor5..." build
RUN pnpm run --filter "@triliumnext/commons" build
RUN pnpm run --filter "@triliumnext/highlightjs" build
RUN pnpm run --filter "@triliumnext/codemirror" build
RUN pnpm run --filter "@triliumnext/share-theme" build
RUN pnpm run server buildAlso, make sure you install all workspace dependencies, not just for the server. Use: RUN pnpm install --ignore-scriptsinstead of filtering only the server. This ensures all packages are available for the build. If you see errors related to native modules (like better-sqlite3), ensure you rebuild them in the correct stage, as your Dockerfile already does. If you get "file not found" errors during the Docker build, check that your If you still hit issues, please share the exact error message from the failing build step. That will help pinpoint the problem. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
When building the ckeditor with the step the following error appears @dosu |
Beta Was this translation helpful? Give feedback.
-
|
The Dockerfile used is not correct, unfortunately. You should base your Dockerfile on the one we are using right now: https://github.com/TriliumNext/Trilium/blob/main/apps/server/Dockerfile The Dockerfile we are using is not standalone, since we install the dependencies and build the application at CI level: https://github.com/TriliumNext/Trilium/blob/main/.github/workflows/main-docker.yml Also, what's the usecase for building it from scratch and not reusing the image that is already available on DockerHub? |
Beta Was this translation helpful? Give feedback.
thanks for your reply.
I wanted to build it on my own just of principle. Instead of pulling it from the container registry, I wanted to build it on my own.
I managed to build it with my docker file above, I made the mistake to filter on server... in the pnpm install directive
RUN pnpm i --ignore-scripts --filter=serverand should have runRUN pnpm install --frozen-lockfile --ignore-scriptsinstead.Thanks again for the hint in the https://github.com/TriliumNext/Trilium/blob/main/.github/workflows/main-docker.yml file
I corrected for everyone interested the working file in my first post.