Update self-hosted Kubernetes deployments examples for compatibility and consistency (#1177)

* fix: Quote variables in `docker-entrypoint.sh`

- This commit adds double quotes around variables in the docker-entrypoint.sh script to prevent word splitting and globbing issues, ensuring the script behaves correctly in all cases.

* fix: Ensure worker/api deployment starts with `OPENAI_API_KEY`

* fix: Add missing `FLY_PROCESS_GROUP` env var to deployments

* fix: Correct `PLAYWRIGHT_MICROSERVICE_URL` in `firecrawl-config`

* fix: Update Docker build options for Apple Silicon compatibility

* fix: Correct `PLAYWRIGHT_MICROSERVICE_URL` in `firecrawl-config`
This commit is contained in:
Tetsuro Yokoyama 2025-02-18 21:33:20 +09:00 committed by GitHub
parent aacbea1d9e
commit 5ac6eb7440
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 11 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash -e
if [ $UID -eq 0 ]; then
if [ "$UID" -eq 0 ]; then
set +e # disable failing on errror
ulimit -n 65535
echo "NEW ULIMIT: $(ulimit -n)"
@ -9,13 +9,13 @@ else
echo ENTRYPOINT DID NOT RUN AS ROOT
fi
if [ $FLY_PROCESS_GROUP = "app" ]; then
if [ "$FLY_PROCESS_GROUP" = "app" ]; then
echo "RUNNING app"
node --max-old-space-size=8192 dist/src/index.js
elif [ $FLY_PROCESS_GROUP = "worker" ]; then
elif [ "$FLY_PROCESS_GROUP" = "worker" ]; then
echo "RUNNING worker"
node --max-old-space-size=8192 dist/src/services/queue-worker.js
elif [ $FLY_PROCESS_GROUP = "index-worker" ]; then
elif [ "$FLY_PROCESS_GROUP" = "index-worker" ]; then
echo "RUNNING index worker"
node --max-old-space-size=8192 dist/src/services/indexing/index-worker.js
else

View File

@ -12,12 +12,12 @@
2. Build Docker images, and host it in your Docker Registry (replace the target registry with your own)
1. API (which is also used as a worker image)
1. ```bash
docker build --no-cache -t ghcr.io/winkk-dev/firecrawl:latest ../../../apps/api
docker build --no-cache --platform linux/amd64 -t ghcr.io/winkk-dev/firecrawl:latest ../../../apps/api
docker push ghcr.io/winkk-dev/firecrawl:latest
```
2. Playwright
1. ```bash
docker build --no-cache -t ghcr.io/winkk-dev/firecrawl-playwright:latest ../../../apps/playwright-service
docker build --no-cache --platform linux/amd64 -t ghcr.io/winkk-dev/firecrawl-playwright:latest ../../../apps/playwright-service
docker push ghcr.io/winkk-dev/firecrawl-playwright:latest
```
3. Replace the image in [worker.yaml](worker.yaml), [api.yaml](api.yaml) and [playwright-service.yaml](playwright-service.yaml)

View File

@ -21,11 +21,14 @@ spec:
args: [ "pnpm", "run", "start:production" ]
ports:
- containerPort: 3002
env:
- name: FLY_PROCESS_GROUP
value: "app"
envFrom:
- configMapRef:
name: firecrawl-config
#- secretRef:
# name: firecrawl-secret
- secretRef:
name: firecrawl-secret
livenessProbe:
httpGet:
path: /v0/health/liveness

View File

@ -8,6 +8,6 @@ data:
HOST: "0.0.0.0"
REDIS_URL: "redis://redis:6379"
REDIS_RATE_LIMIT_URL: "redis://redis:6379"
PLAYWRIGHT_MICROSERVICE_URL: "http://playwright-service:3000/html"
PLAYWRIGHT_MICROSERVICE_URL: "http://playwright-service:3000"
USE_DB_AUTHENTICATION: "false"
HDX_NODE_BETA_MODE: "1"

View File

@ -19,8 +19,11 @@ spec:
image: ghcr.io/winkk-dev/firecrawl:latest
imagePullPolicy: Always
args: [ "pnpm", "run", "workers" ]
env:
- name: FLY_PROCESS_GROUP
value: "worker"
envFrom:
- configMapRef:
name: firecrawl-config
#- secretRef:
# name: firecrawl-secret
- secretRef:
name: firecrawl-secret