{id: deploy}
{id: stand-alone-application-to-deploy}
- A stand-alone Docker image that exposes a single port
Locally
docker build -t flasker .
docker run --rm -p5000:5000 flasker
http://localhost:5000/
{id: digital-ocean}
{id: deployment-on-digital-ocean}
- Digital Ocean
- Go to Marketplace, search for Docker
- Click on Create Docker Droplet
- Basic $5/month
- New York is fine
- Select SSH key
ssh root@remotehost mkdir /data
DOCKER_HOST=ssh://root@remotehost ./deploy.sh
-
We are going to use the /data directory on the host system as our data volume
-
We use the
-d
flag to convert it into a daemon -
We use
--restart unless-stopped
to tell Docker to restert on reboot -
We create a volume on the disk
{id: multi-container-application}
-
A multi-container Docker app using Docker Compose
-
Create Droplet based on Docker
-
ssh to it,
apt-get update
,apt-get dist-upgrade
,reboot
-
DOCKER_HOST="ssh://user@remotehost" docker-compose up -d
Re-deploy
DOCKER_HOST="ssh://user@remotehost" docker-compose build web
DOCKER_HOST="ssh://user@remotehost" docker-compose up -d web
{id: digital-ocean-docker-compose}
{id: linode}
-
Marketplace
-
Search for Docker
-
Images: Debian 9
-
Region: Dallas
-
Nanode
-
Password
-
SSH key