专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

widepath/phpfpm Docker 镜像 - 轩辕镜像

phpfpm
widepath/phpfpm
php container for airwp
0 次下载
🔒 更安全的专业镜像服务
镜像简介版本下载
🔒 更安全的专业镜像服务

airwp

App Containers & Deployments
  • app: The WidePath web application (signup, create/delete sites, etc)
  • caddy-proxy: Proxy direct to app and to php nodes
  • nodesftpd: Multi-node sftp server
  • worker: Backend processes via worker queue (site create/delete, backup, password reset, etc.)
  • vector: Sends event data to logtail from kube
Phpnode Containers
  • caddy-phpnode: phpnode local http server, passes requests to specific phpfpm instance
  • phpfpm: Container for phpfpm daemon
  • purger: Php node daemon that forwards purge requests to CDN (deprecated since StackPath retirement)
  • smtp-relay: An smtp relay daemon that manages a quota of outbound mail per site
  • vector: Sends event data to logtail
Other
  • app-cli: Control the web app from the command line
  • deploy: Tools, scripts, schemes for running all components in dev or production environments
  • purger-plugin: WP plugin that posts requests to purger to perform cache invalidation on site edits
Build a Ubuntu dev node on Mac using Canonical Multipass
  • brew install multipass
  • multipass launch docker --name=docker
  • multipass exec docker -- sudo bash
  • Install the public key for ansible_user into ./.ssh/authorized_keys
  • systemctl edit docker
    • add this at the top (need to explicitly clear ExecStart):
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 --containerd=/run/containerd/containerd.sock
  • Get inside as root: multipass exec docker -- sudo bash
  • systemctl restart docker
  • docker login
  • docker pull widepath/phpfpm:release-0.0.98
  • docker network create widepath_localbackend
  • apt install s3cmd zip
  • docker run -d --name=mysql -e MYSQL_ROOT_PASSWORD=root --network widepath_localbackend -p 3306:3306 mariadb:10.4
  • Then run worker like this: ansible_user=root ansible_pass= MYSQL_ROOT_PASSWORD=root ansible_port=22 WP_UID_FILES=1001 WP_GID_FILES=1001 nodemon
  • Also add the node's IP to an entry in mongo nodes collection
Dev Mode
  • On mac, to get Docker Desktop to expose the Docker API, run this container: docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:2375:2375 bobrik/socat TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
  • Run rastasheep/ubuntu-sshd to emulate the filesystem of a phpnode and sshd on a custom port
  • Have to install sshpass to allow ansible to connect the rastasheep/ubuntu-sshd container over ssh using passwords`
How to Run Scripts Against Production
  • Port forward mongo on local
  • Run portal-meteor app
  • In another shell run meteor shell
  • Now at the prompt, run .load <physical path to script>
  • Output will be in the first windows (the meteor-portal one)

Build for DigitalOcean

  • docker build --platform=linux/amd64 -t <image-name>:<version> .
  • Important to add the --platform=linux/amd64

Keys

  • worker-ansible-phpnode.key

    • Generate this RSA private key
    • Use ansible to install the key on all phpnodes
    • Add the key as a secret in kube
    • Mount the key secret in worker
  • Private key generated on app nodes then authorized on php nodes - this is so the sftpd container can mount the key and ssh to the php nodes

  • Private keys generated on computation nodes then authorized on php nodes - this is so the worker container can ansible to php nodes in order to do backups, etc

  • Install ssh key (just copy paste to ~/.ssh/id_rsa) to bastion host

  • ./deploy/kube/secret-nodesftpd-phpnodes.yml and ./deploy/kube/secret-worker-ansible-phpnodes.yml are the keys that grant nodesftpd and worker to communicate with phpnodes.

  • To copy the regcred secret to the kube-logging namespace: kubectl get secret regcred --namespace=default -o yaml | grep -v '^\s*namespace:\s' | kubectl apply --namespace=kube-logging -f -

  • Mailgun SMTP credentials for *** are used for

    • MAIL_URL in production kube widepath-secret-prod
    • Phpnode smtp-relay daemon SMTP_OUTBOUND_PASSWORD in deploy/ansible/phpnode-service/smtp-relay.yml
    • monitor

Mongo & mgob

  • Dump: mongodump --db=dbname --gzip --archive=wp.gz
  • Restore: mongorestore --gzip --archive=wp.gz

DigitalOcean

  • Create bastion manually and make sure to install ssh private key in ~/.ssh/id_rsa
  • DO_API_TOKEN is required as an environment variable to make the dynamic inventory work
  • Ensure to create tags before launching else errors will occur: doctl compute tag create phpnode
  • launch-inventory is static and represents the base instances. This means, run the launch.yml playbook like this: ansible-playbook -i launch-inventory launch.yml
  • To get ssh key ids: curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer $DO_API_TOKEN' "[***]" or doctl compute ssh-key list

Provision Additional PHP nodes

  • Set the API key: export DO_AUTH_TOKEN=abc123
  • cd ./deploy/ansible
  • Add the host to the ./deploy/ansible/phpnode-provision/launch-inventory-php file
  • ansible-playbook -i phpnode-provision/launch-inventory-php phpnode-provision/launch-php.yml
  • The new node should have been created, now provision required packages and config on the new node:
  • ansible-playbook phpnode-provision/droplet-basics.yml --limit "phpXX"
  • ansible-playbook phpnode-provision/docker.yml --limit "phpXX"
  • ansible-playbook phpnode-provision/php.yml --limit "phpXX"
  • ansible-playbook phpnode-provision/php-packages-outside-docker.yml --limit "phpXX"
  • ansible-playbook phpnode-provision/python.yml --limit "phpXX"
  • ansible-playbook phpnode-provision/reinstall-docker-sdk.yml --limit "phpXX"
  • ansible-playbook phpnode-provision/block-storage.yml --limit "phpXX"
Install key to new node
  • If you need to generate a public key from the private key: ssh-keygen -y -f worker-ansible-phpnode.key > worker-ansible-phpnode.pub
  • ansible-playbook phpnode-provision/keys.yml --limit "phpXX"
Create phpnode services
  • ansible-playbook phpnode-service/caddy-phpnode.yml --limit "phpXX"
  • ansible-playbook phpnode-service/vector/vector-phpnode.yml --limit "phpXX"
  • ansible-playbook phpnode-service/mysql.yml --limit "phpXX"
  • ansible-playbook phpnode-service/purger.yml --limit "phpXX"
  • ansible-playbook phpnode-service/smtp-relay.yml --limit "phpXX"
Install node in app
  • Now add the node ip and name to app: node app-cli/app-cli node add phpXX <private_ip> "websitesca" "docker-standalone"
Add DNS Entry in Cloudflare for new node
  • A phpXX.tor1.airwp.com >> public_ip

Migrate a Node

  • src=phpX1
  • dst=phpX2
  • candidates=$(echo "show databases" | mysql -u root -p -h $src | grep -Ev "^(Database|mysql|performance_schema|information_schema)$")
  • mysqldump --databases $candidates -u root -p -h $src > all.sql
  • MYSQL_CONN="-uroot -p -h $src"
  • mysql ${MYSQL_CONN} --skip-column-names -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user<>''" | mysql ${MYSQL_CONN} --skip-column-names -A | sed 's/$/;/g' > grants.sql
  • Edit grants and remove weird stuff
  • mysql -u root -p -h $dst < all.sql
  • mysql -u root -p -h $dst < grants.sql
  • rsync -chavzP --stats $src:/mnt/airwp/sites/ ./sites
  • rmdir sites/_trash
  • rsync -chavzP --stats ./sites/* $dst:/mnt/airwp/sites
  • app-cli site list --nodename=$src | jq "[.[].siteStub]" > ~/Desktop/nodes/$src.json
  • cat ~/Desktop/nodes/$src.json | python deploy/script/node-change-all.js $dst

Ansible Setup

  • There are 2 files to setup:
  • ~/.ansible/airwp.cfg (get from ./deploy/ansible.cfg.sample)
  • ~/.ansible/airwp-ssh.cfg (get from ./deploy/ssh.cfg.sample)
  • Then export ANSIBLE_CONFIG=~/.ansible/airwp.cfg
  • Should be able to run ansible-playbook in any folder and it will find the inventory
  • Note that the inventory requires the DO_API_TOKEN environment variable

NODESFTPD

Sftpd server for WidePath.

Keys and Auth

Keys need to be generated in a specific format for use with the ssh2 module.

  • ssh-keygen -m PEM -t rsa -f /path/to/wp_key

This will generate /path/to/wp_key (the private key) and /path/to/wp_key.pub (the public key)

Can use ssh-copy-id to authorize the public key on the destination server or use the ansible modules authorized_key.

The format seems to be RSA PKCS#8 ASN1 with a containing public key RSA X.509 ASN1

Production

The app nodes need to be able to ssh to the php nodes. This means we can generate keys on the app nodes then authorize those keys on the php nodes.

Dev

In dev, we just authorize a key from main to php1.

Migrate by Node

From jump node:

  • export source=php6
  • export dest=php10
  • candidates=$(echo "show databases" | mysql -u root -p -h $source | grep -Ev "^(Database|mysql|performance_schema|information_schema)$")
  • mysqldump --databases $candidates -u root -p -h $source > all.sql
  • export MYSQL_CONN="-uroot -p -h $source
  • mysql ${MYSQL_CONN} --skip-column-names -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user<>''" | mysql ${MYSQL_CONN} --skip-column-names -A | sed 's/$/;/g' > grants.sql

Edit grants and remove weird stuff

  • mysql -u root -p -h $dest < all.sql
  • mysql -u root -p -h $dest < grants.sql
  • rsync -chavzP --stats $source:/mnt/airwp/sites/ ./sites
  • rmdir sites/_trash
  • rsync -chavzP --stats ./sites/* $dest:/mnt/airwp/sites
  • app-cli site list --nodename=$source | jq "[.[].siteStub]" > ~/Desktop/nodes/$source.json
  • cat ~/Desktop/nodes/$source.json | python deploy/script/node-change-all.js $dest

Clean up

  • chown -R wp:wp *
  • find . -type f -exec chmod 644 {} \;
  • find . -type d -exec chmod 755 {} \;
  • find . -regex '.*.archive.zip' -exec rm {} \;

Misc

wpcli tricks and shortcuts
  • To add the Formidable Pro API key: wp option add frmpro-credentials 'a:1:{s:7:\"license\";s:23:\"BDN68-YZF5W-GZHKY-YOJJL\";}'
  • To add the Akismet API key: wp option add wordpress_api_key 92f0f8e7bee3
Other stuff:
wp role reset --all
wp user set-role websitesca administrator
wp user update websitesca --nickname=websitesca
sudo -u \#$WP_UID_FILES wp plugin uninstall hello
sudo -u \#$WP_UID_FILES wp theme uninstall twentyfifteen twentysixteen

See memory usage of a container: kubectl exec -it app-d86fcdd6c-lwp9d cat /sys/fs/cgroup/memory/memory.usage_in_bytes

Test fcgi on the command line
  • See: [***]
  • Install this: apt-get install libfcgi0ldbl
  • Then run like this:
Clean up backups that get stuck pending
  • List them all: db.sites.find({backups:{$elemMatch:{'status.pending':true}}}).map(x=>x.siteStub)
  • Delete them all: db.sites.update({}, {$pull:{backups:{'status.pending':true}}}, {multi:true})
DigitalOcean Spaces Lifecycle Policies
  • Must set BucketLifecycle rules via api (can't even use doctl).
  • Set this using scripts/update_do_spaces_widepath_lifecycle.py
To curl or httpie direct to an origin (ie bypass stackpath):
  • httpie: http --headers [***] Host:<sitestub>.widepath.app X-OriginalHost:<hostname> X-SiteStub:<sitestub> --verify=no
  • curl: curl -I [***] -H "X-OriginalHost: <host>" -H "X-SiteStub: <sitestub>" -H "Host: <sitestub>.widepath.app" -k
查看更多 phpfpm 相关镜像 →
mailcow/phpfpm logo
mailcow/phpfpm
mailcow是基于Docker的开源邮件服务器套件,集成SMTP/IMAP/POP3/Webmail等完整功能,支持反垃圾邮件与加密,适用于快速部署安全可靠的邮件服务。
510M+ pulls
上次更新:未知
adhocore/phpfpm logo
adhocore/phpfpm
基于Alpine的轻量级Docker PHP FPM镜像,下载大小约150MB,包含PHP8.0/7.4及78+常用扩展,预装Composer v1和v2,适合生产环境和开发使用。
9100K+ pulls
上次更新:未知
iwfwebsolutions/phpfpm logo
iwfwebsolutions/phpfpm
Web Solutions基础PHP-FPM镜像,包含最常用模块及高级启动脚本和工具,适用于构建自定义PHP Docker环境。
50K+ pulls
上次更新:未知

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
widepath/phpfpm
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.