沐沐言 - 群晖docker
type: channel
link: https://note.camelz.cloudns.ch/index.php/tag/%E7%BE%A4%E6%99%96docker/
items: 群晖docker安装1panel教程并配置mysql和openresty，并用docker compose安装Typecho

群晖docker安装1panel教程并配置mysql和openresty，并用docker compose安装Typecho
type: item
date: 2025-04-21T11:38:00+02:00
description: 用docker安装安装1panel教程并配置mysql和openresty1,确保群晖已经安装docker2，安装 1Panel选的官方的ssh安装方式，使用SSH工具登录，确保root登录，假如不是，在命令行输入sudo -i然后拷贝下边命令安装并运行1panelcurl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sh quick_start.sh3，登录1panel安装成功后，控制台会打印面板访问信息，可通过浏览器访问 1Panel：http://目标服务器 IP 地址:目标端口/安全入口执行 1pctl user-info 命令可获取安全入口（entrance）1panel user-info官方地址：https://1panel.cn/docs/installation/online_installation/4，登录1panel配置mysql先创建mysql的docker-compose.yml在电脑本地创建docker-compose.yml，填入以下内容，保存networks: 1panel-network: external: true services: mysql: command: - --mysql-native-password=on container_name: ${CONTAINER_NAME} deploy: resources: limits: cpus: ${CPUS} memory: ${MEMORY_LIMIT} environment: MYSQL_ROOT_PASSWORD: ${PANEL_DB_ROOT_PASSWORD} # MySQL root 密码 TZ: Asia/Shanghai # 时区设置（直接合并到这里） image: mysql:8.4.5 labels: createdBy: Apps networks: - 1panel-network ports: - ${HOST_IP}:${PANEL_APP_PORT_HTTP}:3306 restart: always volumes: - /volume1/docker/1panel/1panel/apps/mysql/mysql/data/:/var/lib/mysql - /volume1/docker/1panel/1panel/apps/mysql/mysql/conf/my.cnf:/etc/my.cnf - /volume1/docker/1panel/1panel/apps/mysql/mysql/log:/var/log/mysql 进入群晖的docker/1panel/1panel/apps/文件夹，创建mysql/mysql/data文件夹，创建mysql/mysql/conf/my.cnf文件，创建mysql/mysql/log文件，并在/volume1/docker/1panel/1panel/apps/mysql/mysql文件夹并上传刚刚创建的docker-compose.yml选择左侧菜单「容器」->「编排」>「创建编排」，来源那里选择路径选择，输入docker-compose.yml的路径/volume1/docker/1panel/1panel/apps/mysql/mysql/docker-compose.yml 内容，点击“确认”按钮等待部署完成即可。参考地址：https://blog.irec.moe/install_1panel_with_synology_docker.html5，配置openresty方法类似mysqldocker-compose.ymlservices: openresty: image: 1panel/openresty:1.21.4.3-3-3-focal container_name: ${CONTAINER_NAME} restart: always network_mode: host volumes: - /volume1/docker/1panel/1panel/apps/openresty/openresty/conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf - /volume1/docker/1panel/1panel/apps/openresty/openresty/conf/fastcgi_params:/usr/local/openresty/nginx/conf/fastcgi_params - /volume1/docker…