For use as a starter for any WordPress development using Docker Compose.
This is a repo based off of my blog post of making WordPress usable by modern technology.
docker-compose up
Visit localhost:8080.
Admin credentials: (can be overridden with Environment Variables below)
U: admin
P: wordpress
- Docker
- Docker Compose
- An internet connection
Default Value: wordpress
Purpose: DB name to use
Default Value: db
Purpose: DB host to connect to
Default Value: root
Purpose: User to connect to the database
Note: Do not use root
in production
Default Value: secretPASS
Purpose: Password of the user
Default Value: latest
Purpose: Version of WordPress to install
Default Value: false
Purpose: Should wordpress be installed (good for first run).
Default Value: wp-smushit,wp-fastest-cache,google-sitemap-generator,jetpack
Purpose: Comma separated list of plugins to install. Follow guide from GTMetrix.
Default Value: false
Purpose: If plugins should be installed
Default Value: admin
Purpose: Admin username
Default Value: wordpress
Purpose: Admin password
Default Value: nobody@example.org
Purpose: Admin email
Default Value: "http://localhost:8080"
Purpose: Site URL
Folder structure can be used for a headless wordpress install. Create a new folder in the root and edit docker-compose to your liking.
$ git clone git@github.com:andrewwippler/WordPress-Containerization-Boilerplate.git
$ cd WordPress-Containerization-Boilerplate/
$ create-react-app frontend
$ cat > frontend/Dockerfile <<EOF
FROM node:8-alpine
RUN apk add --no-cache \
alpine-sdk \
python \
bash \
lcms2-dev \
libpng-dev \
gcc \
g++ \
make \
autoconf \
automake
WORKDIR /usr/src/app
ADD . .
RUN npm install
RUN npm run build
CMD npm run start
EOF
$ cat >> docker-compose.yml <<EOF
frontend:
build: frontend
volumes:
- ./frontend:/usr/src/app
ports:
- 3000:3000
EOF
$ docker-compose up
Or something along those lines. The frontend would call the http://wordpress
endpoint.
Pull requests are welcomed.
MIT