From c72e4d6dfe450ff23a2225429f10e5bbfc94a0a2 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Mon, 13 Jul 2026 19:44:55 +0200 Subject: [PATCH] fix: repair workshop development startup --- Dockerfile | 3 +-- apps/store/README.md | 6 ++++-- apps/store/docker-compose.yml | 3 ++- apps/store/entrypoint.sh | 3 +++ package.json | 4 +++- turbo.json | 3 +++ 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e0be606bc..aacf8f592 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ FROM node:24.18.0-alpine AS base FROM base AS builder WORKDIR /app +ARG CI='true' RUN apk add --no-cache libc6-compat curl bash && apk update RUN corepack enable pnpm @@ -30,7 +31,6 @@ RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store \ pnpm install --recursive --offline ARG SKIP_ENV_VALIDATION='true' -ARG CI='true' ARG DISABLE_REDIS_LOGS='true' ARG TARGETPLATFORM @@ -82,7 +82,6 @@ COPY nginx.conf /etc/nginx/templates/nginx.conf ENV DB_URL='/appdata/db/db.sqlite' ENV DB_DIALECT='sqlite' ENV DB_DRIVER='better-sqlite3' -ENV AUTH_PROVIDERS='credentials' ENV REDIS_IS_EXTERNAL='false' ENV NODE_ENV='production' diff --git a/apps/store/README.md b/apps/store/README.md index 7146a0eea..9fe923184 100644 --- a/apps/store/README.md +++ b/apps/store/README.md @@ -7,9 +7,11 @@ PocketBase provides the central Workshop API at `store.homarr.dev`. It is not a 1. Copy `.env.example` to `.env` and create a GitHub OAuth app. 2. Set its callback URL to `http://localhost:8090/api/oauth2-redirect`. 3. Set `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET`, `PB_SUPERUSER_EMAIL`, and `PB_SUPERUSER_PASSWORD`. -4. Run `docker compose up --build` from this directory. +4. Run `pnpm dev:workshop` from the repository root. It starts PocketBase and the Docusaurus Workshop together and removes obsolete Compose containers. -The API is at `http://localhost:8090`; the emergency PocketBase dashboard is at `http://localhost:8090/_/`. Day-to-day moderation belongs in `/workshop/admin`, not the PocketBase dashboard. +Open the Workshop at `http://localhost:3003/workshop`. The API is at `http://localhost:8090`; the emergency PocketBase dashboard is at `http://localhost:8090/_/`. `0.0.0.0` in PocketBase's server log is its container bind address, not a browser URL. Day-to-day moderation belongs in `/workshop/admin`, not the PocketBase dashboard. + +Use `pnpm dev:workshop:backend` when only the API is needed. If port 8090 is unavailable, set `PB_EXPOSE_PORT` in `apps/store/.env` and run the website separately with a matching `NEXT_PUBLIC_WORKSHOP_API_URL`. The image downloads the official PocketBase `0.39.6` release and verifies it against that release's `checksums.txt`. Migrations and hooks are mounted read-only. diff --git a/apps/store/docker-compose.yml b/apps/store/docker-compose.yml index a94c67529..03d8d278f 100644 --- a/apps/store/docker-compose.yml +++ b/apps/store/docker-compose.yml @@ -11,8 +11,9 @@ services: GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET:-} PB_SUPERUSER_EMAIL: ${PB_SUPERUSER_EMAIL:-} PB_SUPERUSER_PASSWORD: ${PB_SUPERUSER_PASSWORD:-} + PB_PUBLIC_URL: http://localhost:${PB_EXPOSE_PORT:-8090} ports: - - "${PB_EXPOSE_PORT:-8090}:8090" + - "127.0.0.1:${PB_EXPOSE_PORT:-8090}:8090" volumes: - workshop_data:/pb_data - ./pb_hooks:/pb_hooks:ro diff --git a/apps/store/entrypoint.sh b/apps/store/entrypoint.sh index 2980e66d4..8c5cdd3a9 100644 --- a/apps/store/entrypoint.sh +++ b/apps/store/entrypoint.sh @@ -7,6 +7,9 @@ if [ -n "${PB_SUPERUSER_EMAIL:-}" ] && [ -n "${PB_SUPERUSER_PASSWORD:-}" ]; then su-exec pocketbase pocketbase superuser upsert "${PB_SUPERUSER_EMAIL}" "${PB_SUPERUSER_PASSWORD}" --dir=/pb_data fi +echo "Workshop API: ${PB_PUBLIC_URL:-http://localhost:8090}" +echo "Workshop website: http://localhost:3003/workshop" + exec su-exec pocketbase pocketbase serve \ --http=0.0.0.0:8090 \ --dir=/pb_data \ diff --git a/package.json b/package.json index f8d891f5a..625d32a28 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,9 @@ "db:studio": "pnpm -F db studio", "dev": "pnpm -F nextjs dev", "dev:docs": "pnpm -F @homarr/docs dev", - "dev:workshop": "docker compose -f apps/store/docker-compose.yml up --build", + "dev:workshop": "concurrently --kill-others --names workshop-api,workshop-web \"pnpm dev:workshop:backend\" \"pnpm dev:workshop:website\"", + "dev:workshop:backend": "docker compose -f apps/store/docker-compose.yml up --build --remove-orphans", + "dev:workshop:website": "cross-env NEXT_PUBLIC_WORKSHOP_API_URL=http://localhost:8090 pnpm -F @homarr/docs dev", "docker:dev": "docker compose -f ./development/development.docker-compose.yml up", "format": "turbo format --continue -- --check", "format:fix": "turbo format --continue", diff --git a/turbo.json b/turbo.json index a34257de2..26226ac99 100644 --- a/turbo.json +++ b/turbo.json @@ -35,6 +35,9 @@ "@homarr/db#build": { "outputs": ["migrations/sqlite/migrate.cjs", "migrations/mysql/migrate.cjs", "migrations/postgresql/migrate.cjs"] }, + "@homarr/workshop#build": { + "outputs": ["dist/**"] + }, "@homarr/docs#build": { "inputs": ["$TURBO_DEFAULT$", "../../packages/definitions/src/docs/**"], "outputs": ["build/**", ".docusaurus/**"]