Skip to content

Commit a9dd302

Browse files
authored
feat: Docker build (#13)
1 parent dccf1d6 commit a9dd302

9 files changed

Lines changed: 126 additions & 70 deletions

File tree

.github/workflows/docker.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_PREFIX: ghcr.io/${{ github.repository_owner }}
11+
12+
jobs:
13+
build:
14+
name: Build and Push
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
attestations: write
20+
id-token: write
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
30+
31+
- name: Log in to GHCR
32+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Extract metadata for Docs
39+
id: meta
40+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
41+
with:
42+
images: ${{ env.IMAGE_PREFIX }}/docs
43+
tags: |
44+
type=raw,value=latest
45+
46+
- name: Build and push Docs image
47+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
48+
with:
49+
context: .
50+
file: Dockerfile
51+
push: true
52+
platforms: linux/amd64,linux/arm64
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
cache-from: type=gha
56+
cache-to: type=gha,mode=max
57+
provenance: true
58+
sbom: true

Dockerfile

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,18 @@ FROM node:25-alpine AS builder
22

33
WORKDIR /app
44

5-
COPY package.json package-lock.json* ./
6-
RUN npm ci
5+
RUN apk add --no-cache git
76

87
COPY . .
8+
RUN npm ci
9+
910
RUN npm run build
1011

1112
FROM nginx:alpine
1213

13-
COPY --from=builder /app/dist/client /usr/share/nginx/html/docs
14-
15-
RUN printf 'server {\n\
16-
listen 80;\n\
17-
root /usr/share/nginx/html;\n\
18-
\n\
19-
location /docs {\n\
20-
try_files $uri $uri/ /docs/index.html;\n\
21-
}\n\
22-
\n\
23-
location = / {\n\
24-
return 301 /docs;\n\
25-
}\n\
26-
}\n' > /etc/nginx/conf.d/default.conf
14+
COPY --from=builder /app/dist/client /usr/share/nginx/html
15+
16+
COPY nginx.conf /etc/nginx/conf.d/default.conf
2717

2818
EXPOSE 80
2919

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Alexander Konietzko, Timo Kössler, Maxim Bigler, Maik Niehues
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docker-compose.dev.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
docs:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
container_name: orca-docs
7+
ports:
8+
- "127.0.0.1:8080:80"
9+
restart: unless-stopped

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
docs:
3+
image: orcacd/docs:latest
4+
container_name: orca-docs
5+
ports:
6+
- "127.0.0.1:8080:80"
7+
restart: unless-stopped

nginx.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
index index.html;
6+
7+
location / {
8+
try_files $uri $uri/ /index.html;
9+
}
10+
}

package-lock.json

Lines changed: 1 addition & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"oxlint-tsgolint": "^0.19.0",
4242
"serve": "^14.2.6",
4343
"tailwindcss": "^4.2.1",
44-
"typescript": "^6.0.2",
45-
"vite-tsconfig-paths": "^6.1.1"
44+
"typescript": "^6.0.2"
4645
}
4746
}

vite.config.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ import { tanstackStart } from "@tanstack/react-start/plugin/vite";
33
import react from "@vitejs/plugin-react";
44
import mdx from "fumadocs-mdx/vite";
55
import { defineConfig } from "vite";
6-
import tsConfigPaths from "vite-tsconfig-paths";
7-
import * as MdxConfig from "./source.config";
86

97
export default defineConfig({
10-
base: "/docs",
118
server: {
129
port: 3000,
1310
},
1411
plugins: [
15-
mdx(MdxConfig),
12+
mdx(await import("./source.config")),
1613
tailwindcss(),
17-
tsConfigPaths({
18-
projects: ["./tsconfig.json"],
19-
}),
2014
tanstackStart({
2115
spa: {
2216
enabled: true,
@@ -34,8 +28,20 @@ export default defineConfig({
3428
{
3529
path: "/api/search",
3630
},
31+
{
32+
path: "llms-full.txt",
33+
},
34+
{
35+
path: "llms.txt",
36+
},
3737
],
3838
}),
3939
react(),
4040
],
41+
resolve: {
42+
tsconfigPaths: true,
43+
alias: {
44+
tslib: "tslib/tslib.es6.js",
45+
},
46+
},
4147
});

0 commit comments

Comments
 (0)