This video tutorial shows how to build and run Intershop PWA SSR (Server Side Rendering) images and NGINX Docker images.
This video tutorial shows the relevant steps to build and run PWA SSR images and NGINX Docker images. This includes the following tasks:
docker-compose
commandFor this tutorial we will use Visual Studio Code, but the implementations could, for example, also be done through a command line alone.
git clone https://github.com/intershop/intershop-pwa.git
icmBaseURL
to the running ICM 7.10 server.The demo server for the PWA version 7.10 can be used for testing purposes: "https://jxdemoserver6.intershop.de"
Since PWA version 1.0 the icmBaseURL
needs to be defined in src/environments/environment.model.ts.
docker build --no-cache -t pwa_image .
Run the PWA Docker image with the following command: docker run -d -p 4200:4200/tcp -e SSL=1 -e TRUST_ICM=true --restart always --name pwa_container pwa_image
The multi PWA proxy listening with https is not working with PWA version 1.0 due to the issue HTTPS on SSR container is not working anymore #851. To avoid this issue with PWA 1.0, run the PWA Docker image without the environment variable SSL=1
.
If you want a multi-channel approach to be enabled, open the multi-channel.yaml file under nginx | multi-channel.yaml and adjust it according to your own environment.
.+: - baseHref: /b2c lang: en_US channel: inSPIRED-inTRONICS-Site - baseHref: /b2b lang: en_US channel: inSPIRED-inTRONICS_Business-Site features: quoting,businessCustomerRegistration,advancedVariationHandling,quickorder,orderTemplates,punchout theme: "blue|688dc3"
Since PWA version 1.0 the multi-channel setup has changed. For further information, please take a look at Guide - Intershop Progressive Web App - Multiple Themes.
Open the Dockerfile under nginx | Dockerfile and add the copy instructions for both files:
COPY server.crt /etc/nginx/ COPY server.key /etc/nginx/
Build the NGINX Docker image by running the following command: docker build --no-cache -t nginx_image nginx .
List all Docker containers by running the following command: docker ps -a -s
docker inspect <CONTAINER ID>
docker run -d --name "nginx_container" --restart always -e SSL=1 -e TRUST_ICM=true -p 443:443 -e UPSTREAM_PWA=https://<IPAddress>:4200 nginx_image
docker stop pwa_container
docker stop nginx_container
Adjust the content of the file according to your needs.
version: '3' services: pwa: build: context: . args: configuration: production serviceWorker: 'false' restart: always environment: - LOGGING=on - ICM_BASE_URL - TRUST_ICM=true - SSL=1 nginx: build: nginx depends_on: - pwa restart: always environment: UPSTREAM_PWA: 'https://pwa:4200' CACHE: 1 PAGESPEED: 1 PROMETHEUS: 0 COMPRESSION: 1 DEVICE_DETECTION: 1 MULTI_CHANNEL: | .+: - baseHref: /b2c lang: en_US channel: inSPIRED-inTRONICS-Site - baseHref: /b2b lang: en_US channel: inSPIRED-inTRONICS_Business-Site features: quoting,businessCustomerRegistration,advancedVariationHandling,quickorder,orderTemplates,punchout theme: "blue|688dc3" ports: - '443:443'
Since PWA version 1.0 the multi-channel setup has changed. For further information, please take a look at Guide - Intershop Progressive Web App - Multiple Themes.
Run the command: docker-compose up -d --build