Docker - Wordpress Setup
From GLMWiki
Contents
Docker Compose Wordpress setup
These instructions will setup docker and wordpress. Wordpress will run on apache server on port 80. If you already have a server running on port 80 you'll need to stop the service. You can setup this to run the wordpress on another port like 8080 or 8000 but our plugins, right now, don't function fully on another port. After you get everything running goto localhost and setup the initial wordpress install.
Docker
Setup docker
https://docs.docker.com/install/#server
Docker Compose
Setup docker-compose
https://docs.docker.com/compose/install/
docker-compose.yml
version: '3.3' services: db: image: mysql:5.7 volumes: - ./db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: somewordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest volumes: - ./wordpress:/var/www/html ports: - "80:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress volumes: db_data: wordpress:
Run Docker
docker-compose up -d
Stop Docker
docker-compose down
Post install
You'll need to set the permissions of the wordpress folder to be group writable.
This should be done from within the container.
docker exec -it {docker container name} "bash"