Skip to content

Instantly share code, notes, and snippets.

Last active Dec 4, 2020
What would you like to do?
Setup wordpress using docker. Tested on Ubuntu.
# File: /opt/wordpress/
if [ ! -f "uploads.ini" ]; then
touch ${WORKDIR}/uploads.ini
docker run -d --restart unless-stopped --env-file ${WORKDIR}/.env --name ${APP_NAME} \
-v ${WORKDIR}/wp-content:/var/www/html/wp-content \
-v ${WORKDIR}/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini \
# If docker has no write access to wp-content, wordpress will ask you for FTP details
# when you want to install plugins. This command will allow docker to have write access
# to wp-content.
docker exec ${app_name} chown -R www-data:www-data /var/www/html/wp-content/
Copy link

wzulfikar commented Dec 4, 2020

The script will not expose wordpress container to the world.

You may want to consider setting up nginx with automated https using docker. See:

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