-
Notifications
You must be signed in to change notification settings - Fork 0
Add optional self-hosted mode with SQLite-backed UUID artifact storage #18
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 all commits
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,14 @@ | ||
| # Port for the self-hosted server | ||
| PORT=3001 | ||
|
|
||
| # Path to the SQLite database file | ||
| DB_PATH=./data/agent-render.db | ||
|
|
||
| # Path to the built static export from the main app (npm run build in repo root) | ||
| STATIC_DIR=../out | ||
|
|
||
| # Base URL for generating artifact links in API responses (no trailing slash) | ||
| BASE_URL=http://localhost:3001 | ||
|
|
||
| # TTL in hours for artifact expiry (default: 24) | ||
| TTL_HOURS=24 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| node_modules/ | ||
| data/ | ||
| dist/ | ||
| *.db |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| FROM node:20-slim AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Build the static frontend | ||
| COPY package.json package-lock.json* ./ | ||
| RUN npm ci | ||
| COPY . . | ||
| RUN npm run build | ||
|
|
||
| # Set up the self-hosted server | ||
| FROM node:20-slim | ||
|
|
||
| WORKDIR /app/selfhosted | ||
|
|
||
| # Copy the built static output | ||
| COPY --from=builder /app/out /app/out | ||
|
|
||
| # Install server dependencies | ||
| COPY selfhosted/package.json selfhosted/package-lock.json* ./ | ||
| RUN npm ci --omit=dev | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
|
|
||
| # Copy server source | ||
| COPY selfhosted/src ./src | ||
| COPY selfhosted/tsconfig.json ./ | ||
|
|
||
| # Create data directory for SQLite | ||
| RUN mkdir -p /app/selfhosted/data | ||
|
|
||
| ENV PORT=3001 | ||
| ENV STATIC_DIR=/app/out | ||
| ENV DB_PATH=/app/selfhosted/data/agent-render.db | ||
| ENV BASE_URL=http://localhost:3001 | ||
|
|
||
| EXPOSE 3001 | ||
|
|
||
| VOLUME ["/app/selfhosted/data"] | ||
|
|
||
| CMD ["npm", "start"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| services: | ||
| agent-render: | ||
| build: | ||
| context: .. | ||
| dockerfile: selfhosted/Dockerfile | ||
| ports: | ||
| - "${PORT:-3001}:3001" | ||
| volumes: | ||
| - agent-render-data:/app/selfhosted/data | ||
| environment: | ||
| - PORT=3001 | ||
| - STATIC_DIR=/app/out | ||
| - DB_PATH=/app/selfhosted/data/agent-render.db | ||
| - BASE_URL=${BASE_URL:-http://localhost:3001} | ||
| - TTL_HOURS=${TTL_HOURS:-24} | ||
| restart: unless-stopped | ||
|
|
||
| volumes: | ||
| agent-render-data: |
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.
This image copies only
selfhosted/package.jsonand then runsnpm ci --omit=dev, butrg --files selfhostedshows there is noselfhosted/package-lock.jsonin the repo.npm ciexits withEUSAGEwithout a lockfile, so the documented Dockerfile / Compose deployment path fails before the image is even built.Useful? React with 👍 / 👎.