Skip to main content

Docker and docker-compose

Installing A-Parser on Linux and MacOS via docker is the recommended method, we have prepared an image that includes all the necessary dependencies and libraries for A-Parser and Headless Chrome to work

Before installation

Before installation, you need to register your IP in the Personal Account.

Docker

You need to install Docker on your system.

Installation and launch

Download and unpack the A-Parser distribution:

curl -O https://a-parser.com/members/onetime/ce42f308eaa577b5/aparser-linux-x64.tar.gz
tar zxf aparser-linux-x64.tar.gz
rm -f aparser-linux-x64.tar.gz
note

The download occurs via a one-time link for Linux. You need to get it in the Personal Account, tab A-Parser -> Downloads

Launch using the command:

docker run --rm --name aparser -v $(pwd)/aparser:/app -p 9091:9091 -t aparser/runtime ./aparser -foreground

The option -foreground outputs the content of the log file directly to the terminal:

Apr 27 07:06:53.10427 [master] foreground mode
Apr 27 07:06:54.06409 [master] Found local Chromium: /app/dist/nodejs/node_modules/puppeteer/.local-chromium/linux-856583/chrome-linux/chrome
Apr 27 07:06:55.36487 [master] NodeJS console: [Rank::CMS] total loaded 1446 apps
Apr 27 07:07:19.01377 [master] Start ProxyChecker nocheck
Apr 27 07:07:19.24418 [master] Start ProxyChecker default
Apr 27 07:07:19.62635 [master] A-Parser v1.2.1176-linux-x64 started, tasks: 0 / 2, memory total: 1989 MB, available: 610 MB

After launching, A-Parser will be available at http://127.0.0.1:9091

To run the container in the background, use the command:

docker run --rm --name aparser -v $(pwd)/aparser:/app -p 9091:9091 -t -d aparser/runtime ./aparser

Updating A-Parser

Stop the container:

docker stop aparser

Update A-Parser:

docker run --rm --name aparser -v $(pwd)/aparser:/app -p 9091:9091 -t aparser/runtime ./aparser -foreground -doupdate

After the update is complete, launch A-Parser

note

You can also use the update via the interface or by a one-time link

docker-compose

Download and unpack the A-Parser distribution:

curl -O https://a-parser.com/members/onetime/ce42f308eaa577b5/aparser.tar.gz
tar zxf aparser.tar.gz
rm -f aparser.tar.gz

Create a file docker-compose.yml:

version: '3'

services:
a-parser:
image: aparser/runtime:latest
command: ./aparser
restart: always
volumes:
- ./aparser:/app
ports:
- 9091:9091

Launch A-Parser:

docker compose up -d

TODO: (next) #### Connecting HTTPS through Let's Encrypt