Public Repository

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Run several containers:

docker run -itd \
  --publish=80 \
  --name=express.$(hostname) \
  --restart=always \
  --workdir=/root/express-server \
 --entrypoint=/usr/local/bin/startServer \
  andypotanin/express htop

Bind to host's port:

docker run -it \
  --name=express \
  --net=host \
  -p 80:80 \
  --workdir=/root/express-server \
  --entrypoint=/usr/local/bin/startServer \
  andypotanin/express /bin/bash

Bind to a unique port:

docker run -it --rm \
  --name=express \
  -p 24010:80 \
  --workdir=/root/express-server \
 --entrypoint=/usr/local/bin/startServer \
  andypotanin/express /bin/bash

Or, if you want to start a bunch of servers for testing purposes:

startExpress () {

  ID=$(docker run -itd \
    --name=$1 \
    --hostname=${2-$1} \
    --publish=80 \
    --restart=always \
    --workdir=/root/express-server \
    --volume=/var/log/ \
    --env=NODE_ENV=production \
    --entrypoint=/usr/local/bin/startServer \
    andypotanin/express htop
  )

  echo "Starting Express Server $1 on ${2-*.$1}, ID $ID";

}

startExpress api.site1.com
startExpress api.site2.com
startExpress api.site3.com
startExpress api.site4.com
startExpress api.site5.com
startExpress api.site6.com
startExpress api.site7.com

Or

for i in {12..100}; do
  startExpress "api.site$i.com";
done
Docker Pull Command
Owner
andypotanin

Comments (0)