คุณเคยต้องการเรียนรู้ DevOps ถามว่า "DevOps" คืออะไรหรือต้องการเริ่มเรียนรู้ DevOps?
นี่เป็นตัวอย่างที่มีศักยภาพน้อยที่สุดของแนวคิดหลายอย่างใน DevOps ซึ่งอาจช่วยให้คุณค้นพบวิธีที่ดีกว่าในการทำมันและช่วยให้ผู้อื่นเรียนรู้เช่นกัน
สำรวจ repo นี้ถามคำถามและเรียนรู้
นี่คือเว็บแอปพลิเคชันขั้นต่ำที่มีสถานะ (ฐานข้อมูล) ซึ่ง:
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 สำหรับรายละเอียดเพิ่มเติม
บริการโฮสติ้งคอนเทนเนอร์เป็นบริการโฮสติ้งคอนเทนเนอร์ (คุณเดาได้)
บริการโฮสติ้งคอนเทนเนอร์ชำระเงิน