FTP in Docker Wordpress Container
Published in
1 min readJul 25, 2018
What
Want to connect ftp my docker Wordpress, but not that easy..
How
- Pull this docker image (pure-ftpd)
docker pull stilliard/pure-ftpd:hardened
2. Make a new volume with below command (named files_volume_name_here)
docker run -itd --name ftpd_server -p 21:21 -p 30000-30009:30000-30009 -v files_volume_name_here:/var/www/html -e "PUBLICHOST=localhost" stilliard/pure-ftpd:hardened
3. Connect ftp container, then make new ftp user
Connect my ftp container
docker exec -it ftpd_server /bin/bash
Make ‘admin’ with password
pure-pw useradd admin -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u ftpuser -d /var/www/html
4. Make a New Wordpress container with above volume
wordpress:
image: wordpress:4.8
container_name: wp2
links:
- wordpress_db:mysql
ports:
- 7000:80
volumes:
- files_volume_name_here:/var/www/html
restart: always
privileged: true
(example of docker-compose.yml)
That’s it!