Docker¶
This document describes how you can use Docker Compose to try out the new PxWeb 2.0 with your excisting database. The reason we need Compose is that the new PxWeb access the database through PxWebApi, so we need to run alt least two containers.
Prerequisites¶
-
Git client
-
Docker CLI - via one of these alternatives:
- Docker desktop - Docker desktop (may require license)
- Colima - Colima command-line tool
- Rancher - Rancher desktop
- Podman - Podman desktop
Info
We use services lifecycle hooks from docker-compose v2.30.0 so you may need to upgrade your installation to the latest version for this example to work
-
clone or download this repo https://github.com/PxTools/PxWebApi
git clone https://github.com/PxTools/PxWebApi.git
Database¶
Follow instructions for one of the databases
PX-file database¶
-
Obtain a copy of a PX-file database from a PxWeb 2023 (or older) installation
-
Copy the files to this folder
docker/pxwebapi/Database
If you don't have a copy of your database yet, we can continues with a small sample database
cd docker/pxwebapi/Database unzip tinydatabase.zip
And return to the root folder for the next step
cd ../../../
CNMM database¶
-
It is possible to connect to a CNMM database from Docker, subject to your office's local security policies.
These are the files you need to change. A detailed description is in the customization chapter.
docker/pxwebapi/appsettings.json docker/pxwebapi/SqlDb.config
Start Docker¶
-
Start PxWebApi and PxWeb
docker compose up
During (every) startup in this demo, the Menu.xml
(PX-file database) and
searchindex _INDEX
folder will be regenerated. This can take some time on
lager databases. Since we are still in beta, please do not run this on your
production servers.
-
Your API should now be running on
-
Your PxWeb is also here, but since we have not made the navigation yet, you need to obtain the tableId from the API or
Menu.xml
firsthttp://localhost:8080/table/<tableId>
If you used the tinydatabase.zip this is a valid link