The job worker for handling the jobs that created by the API backend.
Install dependent system libraries:
- GraphicsMagick or ImageMagick
- In Mac OS X, you can simply use Homebrew and do:
$ brew install imagemagick
$ brew install graphicsmagick
Install Gearman.
- Install Gearman on Mac
Install dependent submodules.
$ cd verpix-async
$ git submodule init
$ git submodule update
$ cd verpix-async/object-store
$ git submodule init
$ git submodule update
Install dependent npm modules.
$ npm install
-
Build image
$ docker build -t verpix-async:1.0.0 --build-arg AWS_KEY=$KEY --build-arg AWS_SECRET=$SECRET --build-arg STORE_BKT=$BKT_NAME --build-arg GEARMAN_HOST=$IP ./
-
Create container
$ docker create --restart always $imageId
-
Start container
$ docker start $containerId
Set up a Gearman job server before starting the application.
S3_BKT
The bucket name of the AWS S3 service (no default setting for production mode)G_SERVERS
The server list of the gearman job servers (default: [ { host: 'localhost', port: 4370 } ])
$ npm run dev
There is no default setting for S3_BKT
in production mode, so do remember to specify it manually.
$ S3_BKT='verpix-img-production' npm start
To specify Gearman job servers:
$ G_SERVERS='[ { "host": "192.0.0.1", "port": 1234 }, { "host": "192.0.0.2", "port": 1235 } ]' S3_BKT='verpix-img-production' npm start
$ pm2 show verpix-async
$ pm2 status
$ npm stop