nareshbhatia / docker-demo

Example of running a simple static website using docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Demo

Example of running a simple static website using docker.

Screenshot

Getting Started

Make sure Docker Desktop is installed and running.

Development Build

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.

Running without docker

npm start

Open a browser window at http://localhost:3000/ to see the site.

Running with Docker

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.

Running with Docker Compose

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.

About

Example of running a simple static website using docker


Languages

Language:CSS 84.2%Language:HTML 9.9%Language:JavaScript 4.5%Language:Dockerfile 1.4%