minimalcd
v0.0.46
您是否曾經想過學習DevOps,問“什麼是DevOps”或想開始學習DevOps?
這是DevOps中許多概念的最小可行例子,這些概念可能會幫助您繼續發現更好的方法並幫助他人學習。
探索此倉庫,提出問題並學習
這是一個具有狀態(數據庫)的最小Web應用程序,該應用程序:
main的語義版本自動生成發行版(使用Intuit/auto) cd src
python3.9 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
ENV設置:
cp .env.example .env
cd src
. venv/bin/activate
export FLASK_APP=minimalcd
export FLASK_DEBUG=1
flask run
http://127.0.0.1:5000
podman build -t minimalcd -f src/Dockerfile
podman run -p 8082:80 minimalcd
(幾乎)此點以下的所有內容都是指示,如果您想自己從頭開始設置此問題
APP_NAME=<app-name>
DOKKU_SERVER_IP=<dokku-server-ip>
DOKKU_USERNAME=<username>
git remote add dokku $DOKKU_USERNAME@$DOKKU_SERVER_IP:$APP_NAME
git remote -v show
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku apps:create $APP_NAME
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku git:initialize $APP_NAME
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku builder:set minimalcd build-dir src
git push dokku main
APP_NAME=minimalcd
DOKKU_SERVER_IP=192.168.1.10
DOKKU_USERNAME=dokku
git remote add dokku $DOKKU_USERNAME@$DOKKU_SERVER_IP:$APP_NAME
git remote -v show
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku apps:create $APP_NAME
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku git:initialize $APP_NAME
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku builder-dockerfile:set $APP_NAME dockerfile-path src/Dockerfile
git push dokku main
curl -L https://github.com/intuit/auto/releases/download/v10.36.5/auto-linux.gz > auto-linux.gz
gunzip auto-linux.gz
chmod +x auto-linux
./auto-linux init
# follow on-screen
./auto-linux create-labels
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku apps:destroy --force $APP_NAME
默認情況下,Dokku希望您的Dockerfile位於根目錄中,默認工作目錄是repo的根目錄。
對於更改Dockerfile的名稱/位置,您可以使用builder-dockerfile:set :
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku builder-dockerfile:set $APP_NAME dockerfile-path Dockerfile
為了更改docker build上下文的工作目錄,請使用:
ssh $DOKKU_USERNAME@$DOKKU_SERVER_IP -C dokku builder:set minimalcd build-dir src
有關更多詳細信息,請參見Dokku/Dokku#4502。
集裝箱託管服務是(您猜對了!)容器託管服務,該服務可以自動化您自己的PET Projects上面的所有自動化
結帳容器託管服務