├── .env ├── .gitignore ├── README.md └── docker-compose.yaml /.env: -------------------------------------------------------------------------------- 1 | # DEBUG 1=开启 2 | 3 | DEBUG=1 4 | 5 | # 数据库配置 6 | DB_TYPE=MYSQL 7 | DB_HOST=177.2.0.13 8 | DB_NAME=cloudpanel 9 | DB_USER=root 10 | DB_PASS=cloudpanel 11 | DB_PORT=3306 12 | 13 | REDIS=redis:6379 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # If you prefer the allow list template instead of the deny list, see community template: 2 | # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 3 | # 4 | # Binaries for programs and plugins 5 | *.exe 6 | *.exe~ 7 | *.dll 8 | *.so 9 | *.dylib 10 | 11 | # Test binary, built with `go test -c` 12 | *.test 13 | 14 | # Output of the go coverage tool, specifically when used with LiteIDE 15 | *.out 16 | 17 | # Dependency directories (remove the comment below to include it) 18 | # vendor/ 19 | 20 | # Go workspace file 21 | go.work 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 安装说明 2 | 3 | 机器配置建议大于2c2g!!! 4 | 5 | 安装基础软件 6 | 7 | ```bash 8 | # centos 9 | yum install -y wget curl sudo git 10 | # debian/ubuntu 11 | apt update -y 12 | apt install -y wget curl sudo git 13 | ``` 14 | 15 | 安装docker 16 | ```bash 17 | # 安装docker 18 | curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh 19 | ``` 20 | 下载程序 21 | ```bash 22 | git clone https://github.com/cdntip/cloudpanel-docker.git 23 | cd cloudpanel-docker 24 | docker compose up -d 25 | ``` 26 | 查看管理员账号 27 | ```bash 28 | docker logs cloudpanel-api 29 | 30 | 如果显示 Can't connect to MySQL server on '177.2.0.13' ([Errno 111] Connection refused) 之类的, 执行一下 docker compose restart 再重新查看即可 31 | 32 | ``` 33 | 添加aws镜像 34 | ```bash 35 | # 进入容器 36 | docker exec -it cloudpanel-api /bin/bash 37 | 38 | # 执行 39 | python manage.py aws_update_images 40 | 41 | # 额外添加管理员 42 | python manage.py createsuperuser --username cdntip --email cdntip@admin.com 43 | 44 | ``` 45 | 在浏览器输入 ip+28080 端口即可打开 46 | 一些命令 47 | ```bash 48 | 到 cloudpanel-docker 目录 49 | 50 | docker compose down # 停止全部服务 51 | docker compose up -d # 开启全部服务 52 | docker compose pull # 更新镜像 53 | docker compose restart # 重新创建全部服务 54 | ``` 55 | # 其它说明 56 | 目前只支持 aws、azure、linode、do (单用户) 57 | 后端暂时未上传到github, 但是代码都是未加密的, 在容器中可以看到。 58 | docker 暂时只有x86平台(不支持arm平台) 59 | 目前版本为测试版,有问题请到群里反馈 @cdntip 60 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | networks: 2 | cdntip: 3 | ipam: 4 | driver: default 5 | config: 6 | - subnet: '177.2.0.0/24' 7 | 8 | # 设置mysql,redis持久化保存 9 | volumes: 10 | mysql: 11 | redis: 12 | 13 | services: 14 | web: 15 | image: cdntip/cloudpanel:web 16 | container_name: cloudpanel-web 17 | restart: always 18 | ports: 19 | - '28080:8080' 20 | depends_on: 21 | - api 22 | command: [ 'nginx-debug', '-g', 'daemon off;' ] 23 | networks: 24 | cdntip: 25 | ipv4_address: 177.2.0.11 26 | 27 | api: 28 | image: cdntip/cloudpanel:api 29 | container_name: cloudpanel-api 30 | restart: always 31 | depends_on: 32 | mysql: 33 | condition: service_healthy 34 | redis: 35 | condition: service_healthy 36 | volumes: 37 | - ./.env:/home/python/panel/.env 38 | links: 39 | - mysql 40 | - redis 41 | networks: 42 | cdntip: 43 | ipv4_address: 177.2.0.12 44 | 45 | mysql: 46 | image: mysql:8.1 47 | container_name: cloudpanel-mysql 48 | command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci 49 | restart: always 50 | environment: 51 | MYSQL_DATABASE: 'cloudpanel' 52 | MYSQL_ROOT_PASSWORD: 'cloudpanel' 53 | healthcheck: 54 | test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-pcloudpanel"] 55 | interval: 10s 56 | timeout: 5s 57 | retries: 3 58 | volumes: 59 | - mysql:/var/lib/mysql 60 | networks: 61 | cdntip: 62 | ipv4_address: 177.2.0.13 63 | 64 | redis: 65 | image: redis:6.0.6 66 | container_name: cloudpanel-redis # 容器名 67 | restart: always 68 | volumes: 69 | - redis:/data 70 | healthcheck: 71 | test: ["CMD-SHELL", "redis-cli ping | grep PONG || exit 1"] 72 | interval: 10s 73 | timeout: 5s 74 | retries: 3 75 | networks: 76 | cdntip: 77 | ipv4_address: 177.2.0.14 78 | --------------------------------------------------------------------------------