Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nareshbhatia/docker-demo

Example of running a simple static website using docker
https://github.com/nareshbhatia/docker-demo

Last synced: about 6 hours ago
JSON representation

Example of running a simple static website using docker

Awesome Lists containing this project

README

        

# Docker Demo

Example of running a simple static website using docker.

![Screenshot](assets/screenshot.png)

## Getting Started

Make sure [Docker Desktop](https://www.docker.com/products/docker-desktop/) is
installed and running.

### Development Build

```shell
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

```shell
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):

```shell
npm run docker-build
```

Now run the docker image:

```shell
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

```shell
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.