Example of running a simple static website using docker.
Make sure Docker Desktop is installed and running.
npm ci
npm run dev
Open a browser window at http://localhost:3000/ to see the site. Every time you change the code, you will have to refresh the browser. The underlying server does not have live reloading functionality.
npm start
Open a browser window at http://localhost:3000/ to see the site.
First build a docker image (see Dockerfile
to understand how the image is
built):
npm run docker-build
Now run the docker image:
npm run docker-run
Open a browser window at http://localhost:3000/ to see the site.
Use Docker Desktop to stop and delete the docker-demo
container and the
associated image.
docker compose up
Open a browser window at http://localhost:3000/ to see the site.
Hit control-c to stop docker compose and the docker-demo
container.
Use Docker Desktop to delete the docker-demo
container and the associated
image.