wordpress采用docker部署,部署配置如下:
claves-homepage:
container_name: claves-homepage
hostname: claves-homepage
image: wordpress:5.8.1-apache
restart: always
ports:
- 8087:80
deploy:
resources:
limits:
cpus: '0.5'
memory: 500M
reservations:
memory: 200M
environment:
WORDPRESS_DB_HOST: claves-mysql:4194
WORDPRESS_DB_USER: claves-office
WORDPRESS_DB_PASSWORD: gJR*TqU2rFDSAFASD
WORDPRESS_DB_NAME: www_claves_com_cn
WORDPRESS_TABLE_PREFIX: claves_site_
volumes:
- ./volumes/claves-homepage/www:/var/www/html:rw
- ./volumes/claves-homepage/phpconf/custom.ini:/usr/local/etc/php/conf.d/custom.ini:rw
- ./volumes/claves-homepage/apacheconf/000-default.conf:/etc/apache2/sites-enabled/000-default.conf:rw
logging:
options:
max-size: "10240k"
max-file: "3"
networks:
claves-switch:
ipv4_address: 172.21.0.25
修改/volumes/claves-homepage/phpconf/custom.ini文件,内容见下:
upload_max_filesize = 512M
post_max_size = 512M
upload_max_size = 512M