[新服务] Dockge来替代Portainer管理docker compose

date
Mar 2, 2024
slug
newservice-dockge-portainer-docker-management
status
Published
summary
新服务-
tags
service
type
Post
URL
notion image

Summary

步骤

#1

export DOCKER_PROJ=dockege
export DOCKER_PROJ_DOMAIN=$DOCKER_PROJ.xxx.xxx
mkdir /data/$DOCKER_PROJ && cd /data/$DOCKER_PROJ

mkdir -p stacks data

# either then vi
curl "https://dockge.kuma.pet/compose.yaml?port=55001&stacksPath=/data/dockge/stacks" --output compose.yaml

# or
cat > compose.yaml <<EOF
version: "3.8"
services:
  dockge:
    image: louislam/dockge:1
    restart: unless-stopped
    ports:
      - 55001:5001
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./data:/app/data
      # Stacks Directory
      # ⚠️ READ IT CAREFULLY. If you did it wrong, your data could end up writing into a WRONG PATH.
      # ⚠️ 1. FULL path only. No relative path (MUST)
      # ⚠️ 2. Left Stacks Path === Right Stacks Path (MUST)
      - ./stacks:/data/dockge/stacks
    environment:
      # Tell Dockge where to find the stacks
      - DOCKGE_STACKS_DIR=/data/dockge/stacks
networks:
  default:
    name: npm_nginx_proxy_manager-network
    external: true
EOF

# move projects
PROJ2MOVE=xxx 
cd /data/$PROJ2MOVE; vi docker-compose.yml; docker-compose down; cd ..; 
mv /data/$PROJ2MOVE /data/dockge/stacks

#2

验证

参考

notion image

© Ying Bun 2021 - 2024