การเข้าถึง Dockge
- เปิด browser และไปที่:
https://<SERVER_IP> - คาดว่าจะมีคำเตือน SSL ของ browser (self-signed certificate)
- สร้างบัญชีผู้ดูแลระบบของคุณในการเข้าถึงครั้งแรก
ไฟล์และไดเรกทอรีที่สำคัญ
- ไดเรกทอรีติดตั้ง:
/opt/dockge - เขียนไฟล์:
/opt/dockge/compose.yaml - ไดเรกทอรีสแต็ค:
/opt/stacks - ข้อมูลเชื่อมต่อ:
/opt/dockge/data - Nginx config:
/etc/nginx/sites-available/dockge - ใบรับรอง TLS:
/etc/nginx/ssl
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไข config ของ Nginx และเปลี่ยนทั้งคู่ server_name <IP>; กับโดเมนของคุณ (<your-domain>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/deockge
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
4. รันคำสั่งต่อไปนี้เพื่อสร้าง Let’s Encrypt certificate ที่ใช้ได้:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แทนที่ SSL paths ใน Nginx config:
vim /etc/nginx/sites-available/dockge
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. รีสตาร์ท Nginx เพื่อใช้การเปลี่ยนแปลง:
systemctl restart nginx
7. เปิด browser และไปที่: https://yourdomain.com
หมายเหตุ
- การใช้งาน Dockge
/var/run/docker.sockเพื่อควบคุมDocker - Nginx ได้รับการกำหนดค่าด้วย HTTPS และเปลี่ยนเส้นทาง HTTP → HTTPS
- เฉพาะ Dockge UI เท่านั้นที่ใช้ HTTPS แอพอื่น ๆ ใช้งาน
http://<IP>:<PORT>(ไม่มี HTTPS อัตโนมัติ)