-
Notifications
You must be signed in to change notification settings - Fork 178
feat: add Dockerfile for self-hosted deployment #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||||||||||||||||||||||||
| # ============================================================== | ||||||||||||||||||||||||||||
| # Stage 1: Install dependencies and build frontend | ||||||||||||||||||||||||||||
| # ============================================================== | ||||||||||||||||||||||||||||
| FROM node:22-slim AS builder | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||||||||||||||||||||||||||||
| python3 make g++ \ | ||||||||||||||||||||||||||||
| && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| WORKDIR /app | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Copy workspace package.json files first for layer caching | ||||||||||||||||||||||||||||
| COPY package.json ./ | ||||||||||||||||||||||||||||
| COPY packages/agent-bridge/package.json ./packages/agent-bridge/ | ||||||||||||||||||||||||||||
| COPY packages/doc-core/package.json ./packages/doc-core/ | ||||||||||||||||||||||||||||
| COPY packages/doc-editor/package.json ./packages/doc-editor/ | ||||||||||||||||||||||||||||
| COPY packages/doc-server/package.json ./packages/doc-server/ | ||||||||||||||||||||||||||||
| COPY packages/doc-store-sqlite/package.json ./packages/doc-store-sqlite/ | ||||||||||||||||||||||||||||
| COPY apps/proof-example/package.json ./apps/proof-example/ | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| RUN npm install | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| COPY . . | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Build frontend SPA (Vite → dist/), then merge into public/ so the | ||||||||||||||||||||||||||||
| # Express static middleware can serve the built assets alongside existing | ||||||||||||||||||||||||||||
| # static files, then prune dev dependencies. | ||||||||||||||||||||||||||||
| # Single RUN so dev deps don't persist in any layer. | ||||||||||||||||||||||||||||
| RUN npm run build \ | ||||||||||||||||||||||||||||
| && cp -r dist/* public/ \ | ||||||||||||||||||||||||||||
|
Comment on lines
+25
to
+31
|
||||||||||||||||||||||||||||
| # Build frontend SPA (Vite → dist/), then merge into public/ so the | |
| # Express static middleware can serve the built assets alongside existing | |
| # static files, then prune dev dependencies. | |
| # Single RUN so dev deps don't persist in any layer. | |
| RUN npm run build \ | |
| && cp -r dist/* public/ \ | |
| # Build frontend SPA (Vite → dist/), then copy only built assets into | |
| # public/ so Express can serve them, while keeping dist/index.html in dist/ | |
| # for the server routes to read, then prune dev dependencies. | |
| # Single RUN so dev deps don't persist in any layer. | |
| RUN npm run build \ | |
| && mkdir -p public/assets \ | |
| && cp -r dist/assets/* public/assets/ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy is intentional. Serving the SPA at / via public/index.html is the expected behavior. share-web-routes reads dist/index.html separately for document pages (/d/... routes), not the root. Both paths work correctly with this setup.
Uh oh!
There was an error while loading. Please reload this page.