Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FTP support to oficial WordPress image #67

Open
albreis opened this issue Aug 25, 2021 · 1 comment
Open

Add FTP support to oficial WordPress image #67

albreis opened this issue Aug 25, 2021 · 1 comment

Comments

@albreis
Copy link

albreis commented Aug 25, 2021

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?

@alainseys
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants