Build PWA

npm run build:pwa

This is the command to build the application as a PWA. The app will be dumped in the www folder.

Alternatively you can build and run the app on Docker if you are familiar with it:

Build and run the Prod app on Docker

Building your image

Go to the directory that has your Dockerfile and run the following command to build the Docker image. The -t flag lets you tag your image so it's easier to find later using the docker images command:

$ docker build -t <your username>/wordpress-pwa .

When this is done you should have an image of the production application ready to run!

Your image will now be listed by Docker:

$ docker images

REPOSITORY                      TAG        ID              CREATED
<your username>/wordpress-pwa   latest     d64d3505b0d2    1 minute ago

Run the image

Running your image with -d runs the container in detached mode, leaving the container running in the background. The -p flag redirects a public port to a private port inside the container. Run the image you previously built:

$ docker run -p 5000:8080 -d <your username>/wordpress-pwa

Now open your browser http://localhost:5000 this app should be running smoothly.

Get container ID

$ docker ps
$ docker logs <container id>

Enter the container

$ docker exec -it <container id> /bin/bash

results matching ""

    No results matching ""