2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2020

11/29/2016: Running web server for one dollar a month

Hyper.sh is a secure container hosting service. What makes it different from AWS (Amazon Web Services) is that you don’t start servers, but start docker images directly from Docker Hub or other registries. Hyper.sh is running the containers in a new way, in which multi-tenants’ containers are inherently safe to run side by side on bare metal, instead of being nested in VMs.

Running a $1/month web server

  • Create a Docker volume
./hyper volume create --name=tiny-web-server
  • Create an index.html file on the volume.

    • Open a shell that accesses the Docker volume
./hyper run --size s1 -it --rm --volume tiny-web-server:/www centos /bin/bash
  • Create the file.
echo "Hello World" > /www/index.html
  • Run the web server. Note that it won’t be accessible to the Internet yet.
./hyper run --size s1 --detach --name tiny-web-server -p 80 --volume tiny-web-server:/www fnichol/uhttpd
  • On the hyper.sh website, allocate one of your floating IP addresses.

  • Also on the hyper.sh website, attach a floating IP address to the tiny-web-server container.

Visit your equivalent of http://209.177.88.159/index.html.

That page costs about $1/month to host. ::))

08/20/2016: Running PostgreSQL on Docker Swarm 1.12

For this example, I am using a five node Docker Swarm cluster running on VirtualBox. At this start, I assume the swarm is running and that the swarm master is called pi1.

NOTE: The name ‘pi1’ has no relevance. It can be anything. Just change the references to your name.

  • See the swarm running.
eval $(docker-machine env pi1)
docker node ls
  • Start the postgres service.
eval $(docker-machine env pi1)
docker service create \
  --env POSTGRES_DB=ckan \
  --env POSTGRES_USER=ckan \
  --env POSTGRES_PASSWORD=ckan \
  --publish 5432:5432 \
  --name postgres \
  postgres:9.5
  • Run a command-line client from outside of the swarm.
eval $(docker-machine env --unset)
docker run \
  --add-host postgres:$(docker-machine ip pi1) \
  --env PGPASSWORD=ckan \
  -it \
  --rm \
  postgres:9.5 \
  psql -h postgres -U ckan
  • Use the client.

Do whatever is needed at the postgres command-line and then type ‘\q’ to exit.

  • Stop the service.
eval $(docker-machine env pi1)
docker service rm postgres
eval $(docker-machine env --unset)