-
Docker (Recommended)
- Install Docker
- Spin up the image
- With docker run
docker run --publish 80:80 energyhun24/bandwidth-hero-proxy:latest
- Or with docker compose
services: bandwidth-hero-proxy: container_name: bandwidth-hero-proxy image: docker.io/energyhun24/bandwidth-hero-proxy:latest network_mode: bridge restart: unless-stopped environment: USE_BEST_COMPRESSION_FORMAT: true SHARP_CONCURRENCY: 1 ports: - 80:80/tcp
- Then run compose up
docker compose up -d
- Then run compose up
- With docker run
-
SystemD service
- Clone the repository
https://github.com/energypatrikhu/bandwidth-hero-proxy.git /opt/bandwidth-hero-proxy
- cd into cloned repository
cd /opt/bandwidth-hero-proxy
- Install dependencies
npm install
- Build project
npm run build
- Start service
systemctl start bandwidth-hero-proxy-node.service
- (Optional) Enable service to run at startup
systemctl enable bandwidth-hero-proxy-node.service
- (Optional) Enable service to run at startup
- Clone the repository
-
PM2
- Install PM2 globally
npm install -g pm2
- Clone the repository
https://github.com/energypatrikhu/bandwidth-hero-proxy.git /opt/bandwidth-hero-proxy
- cd into cloned repository
cd /opt/bandwidth-hero-proxy
- Install dependencies
npm install
- Build project
npm run build
- Start pm2 script
pm2 start ecosystem.config.cjs
- (Optional) Save PM2 scripts
This is needed if PM2 autostart is enabled and you want to autostart currently running scripts
pm2 save
- (Optional) Enable PM2 to start at startup
pm2 startup
- (Optional) Save PM2 scripts
- Install PM2 globally
-
MAX_CLUSTER_SIZE
- Maximum number of workers to spawn (ignored if
CLUSTER_SIZE
is set) (default: 4)
- Maximum number of workers to spawn (ignored if
-
CLUSTER_SIZE
- Number of workers to spawn (default: 0 (number of CPU threads))
-
SHARP_CONCURRENCY
- Number of threads to use for image processing (default: 0 (auto))
-
SHARP_CACHE
- Enable sharp cache (default: true)
-
SHARP_SIMD
- Enable sharp SIMD (default: true)
-
USE_BEST_COMPRESSION_FORMAT
- Use format that achieves the best compression (default: false)
-
ENABLE_ALTERNATIVE_FORMAT
- Try alternative format if current format is larger after compression than original (default: false)
-
QUEUE_SIZE_PER_CLUSTER
- Maximum number of requests to queue per cluster (default: false)
-
EXTERNAL_REQUEST_TIMEOUT
- Timeout for external requests (ms) (default: 60000)
-
EXTERNAL_REQUEST_RETRIES
- Number of retries for external requests (default: 5)
-
EXTERNAL_REQUEST_REDIRECTS
- Number of redirects to follow for external requests (default: 10)