This project serves a web-based gallery for viewing PNG plot images. Any PNG images placed in the public/plots/ directory will automatically appear in the gallery at http://localhost:3000.
- Automatically lists and displays all PNG images in
public/plots/ - Live updates: new or updated images appear in the gallery without needing to refresh the page
- Simple, responsive web interface
You can run this server either inside a container with Node.js installed, or by installing Node.js locally.
To build and run the Docker image locally (without publishing to Docker Hub):
You can run the convenience script run_docker.sh or run the following commands manually. Change out the left hand side of the path ($(pwd)/public/plots) to reflect your system. If you have any other services running on port 3000, you can change the port.
./run_docker.shThe previous script just runs these commands:
# Build the Docker image
docker build -t plot-gallery .
# Run the Docker container
docker run -p 3000:3000 -v $(pwd)/public/plots:/app/public/plots plot-gallery --name plot-galleryThis will start the server and mount your local public/plots directory into the container, so you can add images without rebuilding the image.
Run the convenience script stop_docker.sh or:
docker stop plot-gallery-
Install Node.js (version 18 or later recommended).
-
Install dependencies:
npm install
-
Start the server:
From inside the web directory:
```sh
npm start
```
- Open your browser and go to: http://localhost:3000
- Place any
.pngimages you want to display in thepublic/plots/directory. - The gallery at http://localhost:3000 will automatically show all images in that folder.
- Images are refreshed automatically if they are added or updated.
package.json
server.js
public/
index.html
scripts.js
styles.css
plots/
your_images.png