Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules
.git
.gitignore
target
*.md
!package.json
apps/ui/.output
apps/ui/dist
apps/docs/dist
apps/docs/.output
packages/render-engine/dist
packages/render-engine/wasm
.turbo
.vscode
.env*
scripts
signatures
55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Stage 1: Base with Node.js and pnpm
FROM node:20-bookworm-slim AS base
RUN corepack enable && corepack prepare pnpm@10.19.0 --activate

# Stage 2: Install Rust toolchain and wasm-pack for WASM build
FROM base AS rust
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
build-essential \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --target wasm32-unknown-unknown \
&& . "/root/.cargo/env" \
&& cargo install wasm-pack
ENV PATH="/root/.cargo/bin:${PATH}"

# Stage 3: Install dependencies and build WASM + app
FROM rust AS build
WORKDIR /app

# Copy workspace config files first for better layer caching
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json ./
COPY apps/ui/package.json apps/ui/
COPY packages/render-engine/package.json packages/render-engine/
# Create a stub for docs so pnpm workspace resolution doesn't fail
COPY apps/docs/package.json apps/docs/

RUN pnpm install --frozen-lockfile

# Copy Rust crates and build WASM
COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/
RUN pnpm build:wasm

# Copy source for the UI app and render-engine package (not docs source)
COPY packages/render-engine/ packages/render-engine/
COPY apps/ui/ apps/ui/

# Build only the UI app and its dependencies (skip docs)
RUN pnpm --filter @tooscut/ui... build

# Stage 4: Production image — only Node.js + built output
FROM node:20-bookworm-slim AS production
WORKDIR /app

COPY --from=build /app/apps/ui/.output .output

ENV NODE_ENV=production
ENV HOST=::
ENV PORT=3000
EXPOSE 3000

CMD ["node", ".output/server/index.mjs"]
57 changes: 22 additions & 35 deletions apps/docs/source.generated.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
/// <reference types="vite/client" />
import { fromConfig } from "fumadocs-mdx/runtime/vite";

import type * as Config from "./source.config";
import { fromConfig } from 'fumadocs-mdx/runtime/vite';
import type * as Config from './source.config';

export const create = fromConfig<typeof Config>();

export const blog = create.doc(
"blog",
"./content/blog",
import.meta.glob(["./**/*.{mdx,md}"], {
base: "./content/blog",
query: {
collection: "blog",
},
}),
);
export const blog = create.doc("blog", "./content/blog", import.meta.glob(["./**/*.{mdx,md}"], {
"base": "./content/blog",
"query": {
"collection": "blog"
}
}));

export const docs = {
doc: create.doc(
"docs",
"./content/docs",
import.meta.glob(["./**/*.{mdx,md}"], {
base: "./content/docs",
query: {
collection: "docs",
},
}),
),
meta: create.meta(
"docs",
"./content/docs",
import.meta.glob(["./**/*.{json,yaml}"], {
import: "default",
base: "./content/docs",
query: {
collection: "docs",
},
}),
),
};
doc: create.doc("docs", "./content/docs", import.meta.glob(["./**/*.{mdx,md}"], {
"base": "./content/docs",
"query": {
"collection": "docs"
}
})),
meta: create.meta("docs", "./content/docs", import.meta.glob(["./**/*.{json,yaml}"], {
"import": "default",
"base": "./content/docs",
"query": {
"collection": "docs"
}
}))
};
3 changes: 1 addition & 2 deletions apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
"clsx": "^2.1.1",
"color": "^5.0.3",
"comlink": "^4.4.2",
"dexie": "^4.3.0",
"dexie-react-hooks": "^4.2.0",
"konva": "^10.2.0",
"lucide-react": "^0.561.0",
"mediabunny": "^1.40.1",
"nitro": "npm:nitro-nightly@latest",
"postgres": "^3.4.7",
"radix-ui": "^1.4.3",
"react": "^19.2.0",
"react-dom": "^19.2.0",
Expand Down
Loading
Loading