migrate from hono

This commit is contained in:
JCEEE
2026-08-17 07:41:26 +01:00
parent e2b99c45b6
commit 5204e7bdbc
56 changed files with 1815 additions and 3357 deletions
-4
View File
@@ -9,7 +9,6 @@ COPY . .
RUN pnpm install --frozen-lockfile
RUN pnpm --filter frontend build
RUN pnpm --filter proxy build
# Create a standalone production node_modules for frontend
RUN pnpm --filter frontend deploy --prod /deploy/frontend
@@ -29,9 +28,6 @@ COPY --from=builder /app/frontend/build ./frontend
COPY --from=builder /deploy/frontend/node_modules ./frontend/node_modules
COPY --from=builder /deploy/frontend/package.json ./frontend/package.json
# Proxy is bundled into one JS file by esbuild
COPY --from=builder /app/proxy/dist ./proxy
COPY docker/nginx.conf /etc/nginx/http.d/default.conf
COPY docker/entrypoint.sh /entrypoint.sh
+4 -5
View File
@@ -16,7 +16,8 @@ fi
# automigrate generates conflicting snapshots on upgraded stores.
pocketbase serve --http=0.0.0.0:8090 --dir="$PB_DATA" --automigrate=false &
# Wait for PB to be healthy before starting the proxy (which runs migrate).
# Wait for PB to be healthy before starting the app (which runs the schema
# migration on boot).
echo "[entrypoint] Waiting for PocketBase..."
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:8090/api/health >/dev/null 2>&1; then
@@ -26,10 +27,8 @@ for i in $(seq 1 30); do
sleep 1
done
# Start the app (frontend + proxy). The proxy auto-runs schema migration.
# FRONTEND_PORT/PROXY_PORT are set via ENV in the Dockerfile; adapter-node
# reads PORT, the proxy reads PROXY_PORT.
# Start the app (SvelteKit + adapter-node). It auto-runs the schema migration.
# PORT defaults to 3000 (adapter-node); nginx proxies to it.
node /app/frontend/index.js &
node /app/proxy/index.js &
nginx -g 'daemon off;'
-10
View File
@@ -11,16 +11,6 @@ server {
proxy_cache_bypass $http_upgrade;
}
# App's Hono proxy (/api/*).
location /api/ {
proxy_pass http://127.0.0.1:3456;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Browser → internal PocketBase SDK (REST + realtime WebSocket). Only the
# /api subtree the PocketBase JS SDK uses. The admin UI (/_ and everything
# else under /pb/) is intentionally NOT proxied, keeping it internal.