The docker-compose.yml file for this project is a docker-compose configuration to be used only for development purpose. There is
almost zero security in the stack configuration.
It is composed of the Zimit frontend UI and API (of course), but also a local Zimfarm DB, API, worker and UI, so that you can test the whole integration locally.
Zimit frontend UI has two containers, one identical to production and one allowing hot reload of local developments.
Zimit frontend API has one container, slightly modified to allow hot reload of most modifications done to the source code.
Zimfarm UI, API worker, and DB are deployed with official production Docker images.
This container is Zimit frontend UI as served in production (already compiled as a static website, so not possible to live-edit)
This container is Zimit frontend UI served in development mode (possible to live-edit)
This container is Zimit frontend API server (only slightly modified to enable live reload of edits)
This container is a local Zimfarm database
This container is a local Zimfarm API
This container is a local Zimfarm UI
This container is a local Zimfarm worker manager. It pulls the Zimfarm task worker image to execute tasks
This container stores the uploaded files/logs for each task.
-
To start the compose services (without the worker):
cd dev docker compose up --build -
To start the compose services (with a registered worker):
cd dev docker compose --profile worker up --build -
If you are running with worker profile, you will need to create warehouse paths to upload the logs and files for each task.
docker exec -it zimfarm-receiver bash /contrib/create-warehouse-paths.sh
If it is your first execution of the dev stack, you need to create offliners and a "virtual" worker in Zimfarm DB. Thus, you need to start the services without the worker profile till you register a worker.
-
To create offliners:
cd dev ./create_offliners.shThis pulls the latest offliner definitions from the online Zimfarm API and registers them with the dev Zimfarm API. Set
ZIMIT_DEFINITION_VERSIONdefined indev/docker-compose.ymlto the specific version of the zimit scraper you want. -
To register a worker
cd dev ./create_worker.sh
NOTE: These shell scripts have been configured withs some reasonable defaults like:
- admin username is
adminwith passwordadmin. This must be the same as tehINIT_USERNAMEANDINIT_PASSWORDof thezimfarm-apiservice and_ZIMFARM_USERNAMEand_ZIMFARM_PASSWORDof thezimit-apiservice. See the Compose file for the definition of these environment variables. - a worker
test_workerwith 1Gb memory, 1Gb disk and 1 CPU. These are specified in theenvironmentsection of thezimfarm-worker-managertoo.
If you have requested a task via Zimit UI and want to simulate a worker starting this task to observe the consequence in Zimit UI, you might use the dev/start_first_req_task.sh.
Should the API process fail, you might restart it with:
docker restart zimit-zimit_api-1You might open following URLs in your favorite browser:
You can login into Zimfarm UI with username admin and password admin.
The api folder is a Python project that contains the code for the zimit-api described in the Overview while the ui folder is a Vue 3 project.
If you want to contribute code to this project, you would need to install
Hatch for managing dependencies of the Python project and Yarn for the Vue 3 project.
This project is configured to use git pre-commit hooks. If you have set up the Python project, pre-commit would be installed in the virtual environment. To install the hooks, use:
pre-commit installAdditionally, you would need to install Prettier globally on your machine. This is because the pre-commit hook uses your machine's Prettier to lint files in the ui folder.