diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 0000000..85fb669 --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,11 @@ +FROM oven/bun:1-alpine AS build +WORKDIR /app +COPY package.json bun.lock ./ +RUN bun install --frozen-lockfile +COPY . . +RUN bun run build + +FROM nginx:alpine +COPY --from=build /app/.vitepress/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 diff --git a/docs/nginx.conf b/docs/nginx.conf new file mode 100644 index 0000000..c177c9b --- /dev/null +++ b/docs/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ $uri.html /index.html; + } + + # Cache static assets + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +}