Add FTP support to oficial WordPress image
I have this stack file:
version: '3.2'
services: wordpress{id}: image: wordpress:latest deploy: resources: limits: cpus: '0.30' memory: 512M hostname: {id} ports: - {web_port}:80 environment: WORDPRESS_DB_HOST: 172.18.0.1 WORDPRESS_DB_USER: {mysql_user} WORDPRESS_DB_PASSWORD: {mysql_passwd} WORDPRESS_DB_NAME: {mysql_db} WORDPRESS_URL: {public_url} WORDPRESS_CONFIG_EXTRA: | define('FS_METHOD', 'direct'); volumes: - wordpress{id}:/var/www/html:rw networks: - {id} vsftpd: image: fauria/vsftpd environment: - FTP_USER={ftp_user} - FTP_PASS={ftp_pass} - PASV_ADDRESS={ftp_host} - PASV_MIN_PORT={ftp_passive_port} - PASV_MAX_PORT={ftp_passive_port} - FILE_OPEN_MODE=077 - LOCAL_UMASK=077 volumes: - wordpress{id}:/home/vsftpd/{ftp_user}:rw ports: - {ftp_port}:21 - {ftp_passive_port}:{ftp_passive_port} phpmyadmin{id}: image: phpmyadmin/phpmyadmin deploy: resources: limits: cpus: '0.30' memory: 256M hostname: {id} restart: always ports: - {phpmyadmin_port}:80 environment: PMA_HOST: 172.18.0.1 networks: - {id} networks: {id}: volumes: wordpress{id}: driver: local driver_opts: type: none o: bind device: /clientes_everhost/home/{id}/public_html
FTP is working for delete, create, etc. But I can't install plugins and theme from WordPress admin panel with this notice: Installation failed: Could not create directory.
How configure fauria/vsftpd for working with WordPress or any other image in a separeted service?
Hy, @albreis
What is the setting of your wordpress config file (config.php) does it have the following rule ?
define('FS_METHOD', 'direct');`
if not add this settings and as you figured out you need to give the folder you want to edit RW permissions.
volumes:
- wordpress:/var/www/html:**rw**
Worpress wil then be able to connect to you application data directly and this should solve your issue