Using Portainer to Create Custom WordPress Template on Arm64 Based VPS

 This post is to show the steps how to use Portainer to create a custom template to launch your WordPress stack if default stack template is not working.

Related posts:

WordPress Template Error

The default template works well for x86 / x64 architecture. Since I am use Arm64 based VPS to do installation, I am having this error message:

"Deployment error
Status: no matching manifest for linux/arm64/v8 in the manifest list entries, code:1
"

It is because they could not find the arm64 based matching image under that linux repository. What we will need to do to fix this issue is to create a custom template to change image name to right one. 

 

Custom WordPress Template

Based on mysql/mysql-server's supported tags to show, version 8.0 is supporting arm architecture. (https://hub.docker.com/r/mysql/mysql-server/)

 

Lets change db's image from image: mysql:5.7 to image: mysql/mysql-server:8.0 


version: '2'

services:
db:
image: mysql/mysql-server:8.0
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_DATABASE_PASSWORD}
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress

wordpress:
image: wordpress:latest
ports:
- 80
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress

volumes:
db_data:




Create subdomain for your new WordPress site

This is a simple step. Based on your domain name registrar, you can find out the management panel to add a new sub domain for your new workdpress site. Here is an example from my Cloudflare page. 

Change Docker Network

Previously, I have create a custom bridge network, which all of my Dockers joined in. 

 
Change WordPress dockers network to the same network as Nginx.

Nginx Configuration

 

Create Nginx configuration file for WordPress site:

root@560e40a1e1d2:/etc/nginx/conf.d# cat arm1wp.conf 
server {
listen 80;
server_name arm1wp.51sec.eu.org;

location / {
proxy_pass http://mywp_wordpress_1;
proxy_http_version 1.1;
proxy_read_timeout 300;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
}
}



YouTube Video:

版权声明:
作者:siwei
链接:https://www.techfm.club/p/1185.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>