-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun-local-dev.sh
More file actions
executable file
·28 lines (23 loc) · 1.03 KB
/
run-local-dev.sh
File metadata and controls
executable file
·28 lines (23 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Runs Fuma build container. By default, it builds and deploys the docs in DEV mode. Accepts alternative commands.
#
# Usage:
# ./run-local-dev.sh [container_command]
# Arguments:
# [container_command] - Optional, default is "pnpm dev", alternatively: "pnpm build", "bash", ...
# Environment variables:
# CONTAINER_BIN - Container tool, default "podman".
# FUMA_IMAGE - Fuma container image, default "cerit.io/docs/fuma:v15.2.10".
CONTAINER_BIN=${CONTAINER_BIN:-"podman"}
FUMA_IMAGE=${FUMA_IMAGE:-"cerit.io/docs/fuma:v16.4.6"}
CONTAINER_COMMAND=${@:-"pnpm dev"}
FAKE_OPENAI_API_KEY="fake-openai-api-key"
${CONTAINER_BIN} run -it --rm \
-p 3000:3000 \
-v ./content/docs:/opt/fumadocs/content/docs \
-v ./public:/opt/fumadocs/public \
-v ./app/api:/opt/fumadocs/app/api \
-v ./components:/tmp/fumadocs/components_local \
-e STARTPAGE=/en/docs \
-e OPENAI_API_KEY=${FAKE_OPENAI_API_KEY} \
${FUMA_IMAGE} bash -c "cp -rf -t /opt/fumadocs/components/ /tmp/fumadocs/components_local/*; ${CONTAINER_COMMAND}"