I needed to mount my AWS EFS container to my Bitnami/Wordpress image manually. At this point, I already had an EFS that I had used before while experimenting with Fargate. I decided to simplify and reduce costs, and manually setup on an EC2 Instance.
First Create a Docker Volume
docker volume create \
--driver local \
--opt type=nfs \
--opt o=addr=<My EFS DNS Here>,rw,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 \
--opt device=:/ efs
Then Run the Container
docker run -d --name wordpress\
-p 80:8080 -p 443:8443 \
--env WORDPRESS_DATABASE_HOST=< My EC2 Public IP address> \
--env WORDPRESS_DATABASE_PORT_NUMBER=3306 \
--env WORDPRESS_DATABASE_NAME=<My WordPress database name \
--env WORDPRESS_DATABASE_USER=<My database user name> \
--env WORDPRESS_DATABASE_PASSWORD=<My database password> \
--env WORDPRESS_SKIP_BOOTSTRAP=yes \
--env ALLOW_EMPTY_PASSWORD=yes \
-v efs:/bitnami/wordpress \
bitnami/wordpress:latest
Additional Considerations
In my case, the wp-config.php file and the wp-content directory were nested under a /bitnami folder. Running the above docker run command with -v efs:/bitnami/wordpress in this case would actually mount the volume in folder /bitnami/wordpress/bitnami and the stock bitnami container would not be able to find it.
Therefore, I simply copied the wp-config.php and the wp-content folder up one directory. cp wp-config.php ../wp-config.php
for example.
Also, because this is a wordpress site that had already been installed, I had to add the following environment option.
--env WORDPRESS_SKIP_BOOTSTRAP=yes \
Finally, success!