3 ms·
I'm trying this out by deploying my website (static files generated from Jekyll source and served, all in a Docker image). I've written the following instructi
by beneills 10y ago
I'm trying this out by deploying my website (static files generated from Jekyll source and served, all in a Docker image).
I've written the following instructions for updating the site (build new image, push to Docker Hub, pull into hyper.sh, stop previous container, run new one, attach floating IP). Does it seem reasonable?
HYPER_IP=209.177.92.197
LATEST_HASH=$(git log -1 --pretty=format:%h)
IMAGE_NAME=beneills/website:$LATEST_HASH
docker build -t $IMAGE_NAME .
docker push $IMAGE_NAME
hyper pull $IMAGE_NAME
hyper run -d -p 80 --name website $IMAGE_NAME
EXISTING_CONTAINER=$(hyper ps --filter name=website --quiet)
hyper stop $EXISTING_CONTAINER
hyper rm $EXISTING_CONTAINER
hyper run --size=s1 -d -p 80 --name website
beneills/website:2994001
hyper fip attach $HYPER_IP website
- mrmrcoleman 10y agoHey Beneilles, this looks reasonable but I'm not sure where you got your Hyper_IP from. Could you drop a note on the forum [1] or join the slack [2] and ask there? [1] https://forum.hyper.sh/ https://forum.hyper.sh/ [2] https://slack.hyper.sh/ https://slack.hyper.sh/
- TheDong 10y ago> LATEST_HASH=$(git log -1 --pretty=format:%h) LATEST_HASH=$(git rev-parse --short HEAD) is the more normal way to do that. It also looks like you'll have downtime due to deleting then running. Eww.