refactor(workshop): run docs with compose
This commit is contained in:
4 files changed
+24
-20
No files matched your search
@@ -34,6 +34,12 @@ Build the documentation and serve it from PocketBase using the same production i
|
|||||||
pnpm docker:docs
|
pnpm docker:docs
|
||||||
```
|
```
|
||||||
|
|
||||||
Open `http://127.0.0.1:3003`. Set `DOCS_EXPOSE_PORT` to use another host port. The preview container is removed when it stops and does not persist PocketBase data.
|
Open `http://127.0.0.1:3003`. Set `DOCS_EXPOSE_PORT` to use another host port. The preview does not mount or persist PocketBase data.
|
||||||
|
|
||||||
|
This command starts the profiled `docs` service from `apps/workshop/docker-compose.yml`. It does not start the development `workshop` service. Stop and remove the preview with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker compose -f apps/workshop/docker-compose.yml --profile docs rm --stop --force docs
|
||||||
|
```
|
||||||
|
|
||||||
Production data lives in `/pb_data`. The image serves the built Homarr documentation and Workshop UI from `/pb_public`.
|
Production data lives in `/pb_data`. The image serves the built Homarr documentation and Workshop UI from `/pb_public`.
|
||||||
@@ -19,3 +19,19 @@ services:
|
|||||||
- ./pb_migrations:/pb_migrations:ro
|
- ./pb_migrations:/pb_migrations:ro
|
||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
|
|
||||||
|
docs:
|
||||||
|
profiles:
|
||||||
|
- docs
|
||||||
|
build:
|
||||||
|
context: ../..
|
||||||
|
dockerfile: apps/workshop/Dockerfile
|
||||||
|
target: production
|
||||||
|
args:
|
||||||
|
POCKETBASE_VERSION: 0.39.6
|
||||||
|
environment:
|
||||||
|
PB_ALLOWED_ORIGINS: ${PB_ALLOWED_ORIGINS:-*}
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${DOCS_EXPOSE_PORT:-3003}:8090"
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
DOCS_IMAGE=${DOCS_IMAGE:-homarr/docs:local}
|
|
||||||
DOCS_EXPOSE_PORT=${DOCS_EXPOSE_PORT:-3003}
|
|
||||||
|
|
||||||
docker build \
|
|
||||||
--target production \
|
|
||||||
--file apps/workshop/Dockerfile \
|
|
||||||
--tag "$DOCS_IMAGE" \
|
|
||||||
.
|
|
||||||
|
|
||||||
exec docker run \
|
|
||||||
--rm \
|
|
||||||
--name homarr-docs \
|
|
||||||
--publish "127.0.0.1:${DOCS_EXPOSE_PORT}:8090" \
|
|
||||||
--env PB_ALLOWED_ORIGINS='*' \
|
|
||||||
"$DOCS_IMAGE"
|
|
||||||
+1
-1
@@ -23,7 +23,7 @@
|
|||||||
"db:studio": "pnpm -F db studio",
|
"db:studio": "pnpm -F db studio",
|
||||||
"dev": "pnpm -F nextjs dev",
|
"dev": "pnpm -F nextjs dev",
|
||||||
"dev:docs": "pnpm -F @homarr/docs dev",
|
"dev:docs": "pnpm -F @homarr/docs dev",
|
||||||
"docker:docs": "sh apps/workshop/run-docs.sh",
|
"docker:docs": "docker compose -f apps/workshop/docker-compose.yml up --build docs",
|
||||||
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
||||||
"format": "turbo format --continue -- --check",
|
"format": "turbo format --continue -- --check",
|
||||||
"format:fix": "turbo format --continue",
|
"format:fix": "turbo format --continue",
|
||||||
|
|||||||
Reference in new issue
Block a user