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
docker build -t flasker .
docker container stop flask --time 0
docker container rm flask
docker run -d --name flask -v/data:/data --env COUNTER_DIR=/data --restart unless-stopped -p5000:5000 flasker
-
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