Skip to content

sashee/static-http-preview-server-using-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

static-http-preview-server-using-docker

This is a simple HTTP static preview server that can be used to showcase web dev work with ease. It is a Docker container with SSHD and a password protected Nodejs server.

Usage

Setting up

The following steps are needed to fire up the preview server:

  • Add your SSH public key to authorized_keys
  • In config.json, set a suitable cookieSecret and add your users using the template provided

Deploying

Build with Docker and run at an available server. Don't forget to expose ports 22 and 8080.

For example, using 8001 and 8002 for SSHD and the preview server, respectively:

docker run -p 8001:22 -p 8002:8080 -d <imageId>

Using different port pairs for each preview server, you can easily run several simultaneously on a single machine, and the users who can access and update are individually configurable.

Updating the preview code

Everything you put under /preview will be available through the root path on the Nodejs server after authentication.

An example, using rsync and ssh port 8001:

rsync -azP --delete -e 'ssh -p 8001' . root@<ip>:/preview

Then navigating to http://<ip>:8002 and logging in, you'll have access to the code you uploaded.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published