- Rollup has been configured to emit modules (as Routify expects) to
public/modules
. - Make sure
public/index.html
has the proper css and js import statements- Including
modules/main.css
- Including
- To use the material styles within SMUI, you must import components with
/styled
appended to the import source. (This is part of the SMUI "Advanced Styling Method")- i.e.
import Button from '@smui/button/styled';
versus@smui/button
- i.e.
- You may wish to create a simple, small, fast container that can run anywhere.
- This
Dockerfile
runs a multistage build:- First (intermediate) container uses node to build the app.
- Second (final) container copies the output of
npm run bulid
(public
folder) into a minimal linux distro to run the nginx web server.
- The
nginx-spa.conf
, configured for an SPA, is copied into the container. You should review and refine this file to suit your needs.
- Install Docker on your system.
- Build the docker image following the directives in the Dockerfile
docker build -t johnknapp/spa-template .
Change the tag name as needed. - Run the image you just built in your local development environment.
docker run --rm -p80:8080 johnknapp/spa-template
. (The --rm flag removes the container upon exit.) - Think about the nginx listenting port and the docker container external:internal ports you use.
docker help
docker image ls
docker image prune
docker ps -a
docker exec -it <cid> /bin/sh
(container id)docker container logs -f <cid>
docker container prune
- Before you can deploy your containerized SPA, you need to push your container to a container registry. Registry details for two popular low-cost hosting options:
- You may also choose to push your container to a private container registry you host yourself or use Docker Hub or a similar service.