Skip to content

Instantly share code, notes, and snippets.

@vpetersson
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpetersson/5df345dbf41197c455f5 to your computer and use it in GitHub Desktop.
Save vpetersson/5df345dbf41197c455f5 to your computer and use it in GitHub Desktop.
Set up Wordpress with docker

Start a MySQL Container

$ docker run -d \
    --name mysql \
    -e MYSQL_ROOT_PASSWORD=mysecretpassword \
    mysql

Start a WordPress container

$ export WPTHEME="/path/to/theme"
$ docker run -d \
    --name wordpress \
    --link mysql:mysql \
    -p 80:80 \
    -v "$WPTHEME":/var/www/html/wp-content/themes/my_theme \
    wordpress

Win

Point your browser to http://$DOCKERHOST.

If you're using boot2docker, $DOCKERHOST will be the host of your boot2docker VM (which you can get by running env).

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