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 #!/bin/bash -e
if [ $UID -eq 0 ]; then if [ "$UID" -eq 0 ]; then
set +e # disable failing on errror set +e # disable failing on errror
ulimit -n 65535 ulimit -n 65535
echo "NEW ULIMIT: $(ulimit -n)" echo "NEW ULIMIT: $(ulimit -n)"
@ -9,13 +9,13 @@ else
echo ENTRYPOINT DID NOT RUN AS ROOT echo ENTRYPOINT DID NOT RUN AS ROOT
fi fi
if [ $FLY_PROCESS_GROUP = "app" ]; then if [ "$FLY_PROCESS_GROUP" = "app" ]; then
echo "RUNNING app" echo "RUNNING app"
node --max-old-space-size=8192 dist/src/index.js 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" echo "RUNNING worker"
node --max-old-space-size=8192 dist/src/services/queue-worker.js 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" echo "RUNNING index worker"
node --max-old-space-size=8192 dist/src/services/indexing/index-worker.js node --max-old-space-size=8192 dist/src/services/indexing/index-worker.js
else 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) 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. API (which is also used as a worker image)
1. ```bash 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 docker push ghcr.io/winkk-dev/firecrawl:latest
``` ```
2. Playwright 2. Playwright
1. ```bash 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 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) 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" ] args: [ "pnpm", "run", "start:production" ]
ports: ports:
- containerPort: 3002 - containerPort: 3002
env:
- name: FLY_PROCESS_GROUP
value: "app"
envFrom: envFrom:
- configMapRef: - configMapRef:
name: firecrawl-config name: firecrawl-config
#- secretRef: - secretRef:
# name: firecrawl-secret name: firecrawl-secret
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /v0/health/liveness path: /v0/health/liveness

View File

@ -8,6 +8,6 @@ data:
HOST: "0.0.0.0" HOST: "0.0.0.0"
REDIS_URL: "redis://redis:6379" REDIS_URL: "redis://redis:6379"
REDIS_RATE_LIMIT_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" USE_DB_AUTHENTICATION: "false"
HDX_NODE_BETA_MODE: "1" HDX_NODE_BETA_MODE: "1"

View File

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