Hi János Nagy thank you for the comment. Yesterday I wanted to (quickly) deploy SPFx version 1.12.1 (last version supporting SP2019) as a Docker image and as alpine version. Unfortunately, there were some problems with the permissions, so that an npm i resulted in errors. When I have a bit more time, I will take a closer look. In the meantime, you can use the official Docker image version 1.12.1 (docker pull m365pnp/spfx:1.12.1) and install spfx-fast-serve manually (or modify the Dockerfile and add spfx-fast-serve).
For example:
FROM node:14.17.0
EXPOSE 5432 4321 35729
ENV NPM_CONFIG_PREFIX=/usr/app/.npm-global \
PATH=$PATH:/usr/app/.npm-global/bin
VOLUME /usr/app/spfx
WORKDIR /usr/app/spfx
RUN useradd --create-home --shell /bin/bash spfx && \
usermod -aG sudo spfx && \
chown -R spfx:spfx /usr/app
USER spfx
RUN npm i -g gulp@4 yo @microsoft/generator-sharepoint@1.12.1 spfx-fast-serve
CMD /bin/bash
Hi Sergej,
Thanks a lot for your article as it helped me fix several issues I've been struggling with for hours when trying to use to the 'docker image for SPFx 1.15.0' (https--hub.docker.com/r/m365pnp/spfx/) on Windows 10.
As I'm new to docker (with WSL 2), I had a first issue (not mentioned in your article) to copy and install the trusted dev certificate:
But that was not enough as I bumped into the 2nd issue dealing with the web part not available in the workbench (same problem as you mentioned in your article). Although that's a known issue with >=1.14.0 as reported on the 'docker m365pnp/spfx page' (https--hub.docker.com/r/m365pnp/spfx/), the proposed fix simply doesn't work (the ipAddress attribute does not exist)! After many tryouts, both fixes for 1.13.1 still applies:
After these changes, the web part appears and run correctly in the workbench.
Note: sorry for the links but I could not include any url in my comment (as I'm new Hashnode user) :-(
János Nagy
Business process analyst and SharePoint admin
Hi! Thanks for the great article. I tried but ultimately failed to convert your solution to SharePoint 2019 on-premises. Should you have time, could you publish a docker file that works with SPFx 1.4.1 and includes the fast serve package? Thanks a lot!