diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..e9cf09d --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,58 @@ +name: Docker + +on: + push: + branches: + - main + +env: + REGISTRY: ghcr.io + IMAGE_PREFIX: ghcr.io/${{ github.repository_owner }} + +jobs: + build: + name: Build and Push + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 + + - name: Log in to GHCR + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docs + id: meta + uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0 + with: + images: ${{ env.IMAGE_PREFIX }}/docs + tags: | + type=raw,value=latest + + - name: Build and push Docs image + uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 + with: + context: . + file: Dockerfile + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + provenance: true + sbom: true diff --git a/Dockerfile b/Dockerfile index a3255d8..5132021 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,28 +2,18 @@ FROM node:25-alpine AS builder WORKDIR /app -COPY package.json package-lock.json* ./ -RUN npm ci +RUN apk add --no-cache git COPY . . +RUN npm ci + RUN npm run build FROM nginx:alpine -COPY --from=builder /app/dist/client /usr/share/nginx/html/docs - -RUN printf 'server {\n\ - listen 80;\n\ - root /usr/share/nginx/html;\n\ -\n\ - location /docs {\n\ - try_files $uri $uri/ /docs/index.html;\n\ - }\n\ -\n\ - location = / {\n\ - return 301 /docs;\n\ - }\n\ -}\n' > /etc/nginx/conf.d/default.conf +COPY --from=builder /app/dist/client /usr/share/nginx/html + +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..46e4578 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Alexander Konietzko, Timo Kössler, Maxim Bigler, Maik Niehues + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..22dd1be --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,9 @@ +services: + docs: + build: + context: . + dockerfile: Dockerfile + container_name: orca-docs + ports: + - "127.0.0.1:8080:80" + restart: unless-stopped diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6fc321c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +services: + docs: + image: orcacd/docs:latest + container_name: orca-docs + ports: + - "127.0.0.1:8080:80" + restart: unless-stopped diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..1a30e15 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,10 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index acb7066..6f1643a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,8 +34,7 @@ "oxlint-tsgolint": "^0.19.0", "serve": "^14.2.6", "tailwindcss": "^4.2.1", - "typescript": "^6.0.2", - "vite-tsconfig-paths": "^6.1.1" + "typescript": "^6.0.2" } }, "node_modules/@babel/code-frame": { @@ -5610,13 +5609,6 @@ "node": ">= 6" } }, - "node_modules/globrex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", - "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", - "dev": true, - "license": "MIT" - }, "node_modules/goober": { "version": "2.1.18", "resolved": "https://registry.npmjs.org/goober/-/goober-2.1.18.tgz", @@ -9410,42 +9402,6 @@ } } }, - "node_modules/vite-tsconfig-paths": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-6.1.1.tgz", - "integrity": "sha512-2cihq7zliibCCZ8P9cKJrQBkfgdvcFkOOc3Y02o3GWUDLgqjWsZudaoiuOwO/gzTzy17cS5F7ZPo4bsnS4DGkg==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.1.1", - "globrex": "^0.1.2", - "tsconfck": "^3.0.3" - }, - "peerDependencies": { - "vite": "*" - } - }, - "node_modules/vite-tsconfig-paths/node_modules/tsconfck": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz", - "integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==", - "dev": true, - "license": "MIT", - "bin": { - "tsconfck": "bin/tsconfck.js" - }, - "engines": { - "node": "^18 || >=20" - }, - "peerDependencies": { - "typescript": "^5.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/vitefu": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz", diff --git a/package.json b/package.json index 00be887..6d9ed77 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "oxlint-tsgolint": "^0.19.0", "serve": "^14.2.6", "tailwindcss": "^4.2.1", - "typescript": "^6.0.2", - "vite-tsconfig-paths": "^6.1.1" + "typescript": "^6.0.2" } } diff --git a/vite.config.ts b/vite.config.ts index 3a2cf79..aa595f0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,20 +3,14 @@ import { tanstackStart } from "@tanstack/react-start/plugin/vite"; import react from "@vitejs/plugin-react"; import mdx from "fumadocs-mdx/vite"; import { defineConfig } from "vite"; -import tsConfigPaths from "vite-tsconfig-paths"; -import * as MdxConfig from "./source.config"; export default defineConfig({ - base: "/docs", server: { port: 3000, }, plugins: [ - mdx(MdxConfig), + mdx(await import("./source.config")), tailwindcss(), - tsConfigPaths({ - projects: ["./tsconfig.json"], - }), tanstackStart({ spa: { enabled: true, @@ -34,8 +28,20 @@ export default defineConfig({ { path: "/api/search", }, + { + path: "llms-full.txt", + }, + { + path: "llms.txt", + }, ], }), react(), ], + resolve: { + tsconfigPaths: true, + alias: { + tslib: "tslib/tslib.es6.js", + }, + }, });