Add documentation build step to Dockerfile and update Documentation link in Sidebar

This commit is contained in:
Sergey Krashevich 2023-05-21 21:15:15 +03:00
parent 846a180a7b
commit 7205d4d6a3
No known key found for this signature in database
GPG Key ID: 625171324E7D3856
3 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,6 @@
README.md README.md
docs/ docs/node_modules
docs/build
.gitignore .gitignore
debug debug
config/ config/

View File

@ -30,6 +30,13 @@ WORKDIR /rootfs/usr/local/go2rtc/bin
RUN wget -qO go2rtc "https://github.com/AlexxIT/go2rtc/releases/download/v1.5.0/go2rtc_linux_${TARGETARCH}" \ RUN wget -qO go2rtc "https://github.com/AlexxIT/go2rtc/releases/download/v1.5.0/go2rtc_linux_${TARGETARCH}" \
&& chmod +x go2rtc && chmod +x go2rtc
FROM --platform=$BUILDPLATFORM node:16 AS docs-build
ADD ./docs /docs
ADD labelmap.txt /
WORKDIR /docs
RUN sed -i'' "s/baseUrl: '\/',/baseUrl: '\/docs\/',/" ./docusaurus.config.js
RUN npm install
RUN npm run build
#### ####
# #
@ -246,6 +253,7 @@ WORKDIR /opt/frigate/
COPY frigate frigate/ COPY frigate frigate/
COPY migrations migrations/ COPY migrations migrations/
COPY --from=web-build /work/dist/ web/ COPY --from=web-build /work/dist/ web/
COPY --from=docs-build /docs/build/ web/docs/
# Frigate final container # Frigate final container
FROM deps AS frigate FROM deps AS frigate

View File

@ -6,6 +6,7 @@ import { ENV } from './env';
import { useMemo } from 'preact/hooks' import { useMemo } from 'preact/hooks'
import useSWR from 'swr'; import useSWR from 'swr';
import NavigationDrawer, { Destination, Separator } from './components/NavigationDrawer'; import NavigationDrawer, { Destination, Separator } from './components/NavigationDrawer';
import { baseUrl } from './api/baseUrl';
export default function Sidebar() { export default function Sidebar() {
const { data: config } = useSWR('config'); const { data: config } = useSWR('config');
@ -57,7 +58,7 @@ export default function Sidebar() {
<Separator /> <Separator />
</Fragment> </Fragment>
) : null} ) : null}
<Destination className="self-end" href="https://docs.frigate.video" text="Documentation" /> <Destination className="self-end" href={baseUrl+"/docs"} text="Documentation" />
<Destination className="self-end" href="https://github.com/blakeblackshear/frigate" text="GitHub" /> <Destination className="self-end" href="https://github.com/blakeblackshear/frigate" text="GitHub" />
</NavigationDrawer> </NavigationDrawer>
); );