Background for info
As many of you know, i do not use docker day to day, personally prefering the VPS/FTP route.
However, recently i found myself in need to the use of UUIDs as primary keys in a project and found the known issue with knex() and MySql not returning UUID identities on insert problematic.
So i decided to go the Docker route and use PostgreSQL.
The Problem
All went without issues until I went to install one of my own server extensions.
The extension appeared to install when installed form the Project/Extensions tab but i could not see the extension in the Server connect list.
I then went to check for the node module and noticed that there is no node_modules folder when using docker (intrigued as to why it's not necessary)
After several restarts i manually installed the files in the extensions/server_connect_modules folder which worked correctly but is far from ideal.
Is there something additional i need to do to make my extensions compatible with Docker?
Can't believe nobody from the 100s of downloads has highlighted this issue to me.
(not yet tested in production, development only)
This is what I understand from building and deploying web apps via Docker in Wappler.
When deploying a project in Docker (locally or remotely), the node modules are installed via the package.json file. Basically, everytime a project is deployed via Docker, it installs the packages.
There are two files that drive this process: docker-compose.yml and Dockerfile. Both files are available here .wappler > targets > target_name > docker-compose.yml and .wappler > targets > target_name > web > Dockerfile.
I don't think this is related to Docker or the absence of node_modules folder. I have come across this issue where the extension was installed correctly, but it didn't add any npm modules and files in the extensions/server_connect_modules folder that were needed to run this extension. I had to manually copy the files and add the npm module in the package.json file before re-deploying the docker project.
At the time, I thought it was something wrong with my setup, but it seems it may be an issue or a bug with the installation of extensions itself.
Thanks
did check docker-compose.yml and Dockerfile after finding this post.
Exactly as I have just found
In the above post I ahve just found JonL suggests a fix which @George later reports as "improved"
My dockercompose.yml does have that recommendation added
I see you are raising a good point here about the docker based projects and the installation of the custom Wappler extensions.
There is indeed an extra step involved in the packaging of your custom extension to solve this problem.
You have to include an additional copy files post install script within the extension itself that is run on install and copies the required files in the extensions project folder and from there they are distributed to the rest.
Maybe you can come up with more universal copy script than the one above, one that works for as well server-connect as app_connect extensions and their folders.
With App Connect extensions it is a bit more challenging because there might be some additional js/css files that need to be copied from within the node_modules. Those are usually referenced in the copyFiles key in the components.hjson and should go inside the extensions folder as well and the copyFiles key should be changed to refer as src the extensions as root.
Updated npm then installed to a test docker project via project/externsions but i am not seeing any files installed to extensions/server_connect/module on install
If any use, here is a log file. I can see a reference to the instansion installation but dont know exacly what i should be seeing
Thank you so much, I did supsect that may be something like that but hadnt had a chance to do tests (been at eye hospital this morning, no going blind - yet!)
I will get all my extensions updated asap and look at extending that script to include app connect extensions as a thank you.
Will also add that to the appropriate docs topic for reference.