Skip to content

Instantly share code, notes, and snippets.

@katpadi
Last active August 29, 2015 14:04
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 katpadi/ac21b526bde5640dc6bb to your computer and use it in GitHub Desktop.
Save katpadi/ac21b526bde5640dc6bb to your computer and use it in GitHub Desktop.
Docker x Fig x WordPress

Docker x Fig x WordPress

Personal notes for my local WP development environment. Because I used to run Vagrant then, I took an arrow to the knee.


Install Docker, m*therfucker.

sudo sh -c "echo deb https://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list" 
sudo apt-get update 
sudo apt-get install lxc-docker

Docker repository key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

Install Fig

sudo su 
curl -L https://github.com/orchardup/fig/releases/download/0.5.1/linux > /usr/local/bin/fig 
chmod +x /usr/local/bin/fig

Check to verify the installation

docker --version 
fig --version 

The fig.yml file

mysql:
  image: orchardup/mysql
  environment:
    MYSQL_DATABASE: wordpress
    MYSQL_ROOT_PASSWORD:

wordpress:
  image: wordpress
  links:
    - mysql:mysql
  ports:
    - "8888:80"
  volumes:
    - "wp-content:/var/www/html/wp-content"

Actually running it

export MYSQL_ROOT_PASSWORD=whateverpasswordyouwant
fig rm
fig up -d mysql
fig up --no-deps -d wordpress

Some other stuff

Useful tool to enter a Docker container

docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter

As suggested by a certain Docker fanboy a.k.a. @themarksteve.

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