in order to test my Excel add-in in a "realistic environment" I am trying to deploy my add-in in a Docker container, however it seems Excel can't reach my add-in running in Docker. I am pretty sure this has something to do with HTTPS, since I am able to access my extension from a browser (only with HTTP though). I initially created my add-in using the Yeoman generator and the React taskpane template, just to be clear.
Here is my Dockerfile:
FROM node:14.2.0-alpine3.10 as build
RUN echo "*** Build Phase ***"
WORKDIR .
ENV PATH ./node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN npm ci
COPY . ./
RUN npm run build
FROM nginx:stable-alpine
RUN echo "*** Deployment Phase ***"
COPY --from=build ./dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
The first part builds my add-in for production in a clean node environment (npm run build uses webpack to minimize and compile my code in a ./dist folder). The second part of the Dockerfile just creates a simple nginx server for hosting my production ready add-in from the dist folder.
After building my Docker image with this file, I run it with docker run -it --rm -p 3000:80 addin:1
to start the nginx server running in Docker.
During development, the npm run start
and npm run dev-server
commands generate SSL certificates for my addin thanks to the office-addin-dev-certs
package and it just works "out of the box".
What should I change in my Dockerfile/nginx to get my add-in served via HTTPS ? And how should I create my SSL certficates ?