Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
00a9a0c
wip 03/16/2016
Mar 16, 2016
b0d2fe7
removing rando ipython files
Mar 16, 2016
eb58ebb
adding _env.example file
Mar 17, 2016
9746435
adding _env.example
Mar 17, 2016
e819ca3
starting to add nginx
Mar 21, 2016
ef22630
docker-entrypoint.py tweak
Mar 21, 2016
4f1e201
WIP 03212016
Mar 22, 2016
02c3b28
wip
Mar 22, 2016
1422c57
env test
Mar 22, 2016
0e4d512
onstart.sh script done, retiring the python version
Mar 22, 2016
19159bc
removing python dependancy and cleaning up Dockerfile
Mar 22, 2016
fdb2aed
Merge branch 'wordpress' into add-nginx
Mar 22, 2016
2f6edbc
nginx working
Mar 22, 2016
6fb103f
removing themes from repo
Mar 22, 2016
81882fc
post status call 03/29/2106
Mar 29, 2016
00798dd
consul in env var
Mar 29, 2016
4c4cf9c
switching over to tim's nginx image
Mar 29, 2016
2c9db30
wip - nginx from image
Mar 30, 2016
110cf3a
adding hyperdb
Mar 30, 2016
fc8944b
finally adding the WP uniques to the env and wp-config.php.ctmpl
Mar 30, 2016
05d8824
moving on up
misterbisson Mar 31, 2016
5bde084
forgot Containerbuddy
misterbisson Mar 31, 2016
c588382
Merge pull request #1 from autopilotpattern/move-back
misterbisson Mar 31, 2016
38c07ea
wip
Mar 31, 2016
bc363b5
Merge branch 'wordpress' of github.com:10up/triton-wordpress into wor…
Mar 31, 2016
1eeae3a
wip 04012016
Apr 1, 2016
16e2c55
nfs WIP 04/04/2106
Apr 4, 2016
01bbf79
Merge pull request #2 from 10up/nfs
misterbisson Apr 5, 2016
4e2a6ee
containerbuddy 1.3
misterbisson Apr 5, 2016
e4e4456
Merge pull request #3 from autopilotpattern/persnickety
misterbisson Apr 5, 2016
4045787
cleanup after renaming
misterbisson Apr 5, 2016
97dd89c
Merge pull request #4 from autopilotpattern/persnickety
misterbisson Apr 5, 2016
e56a3aa
WIP 04/05/2016
Apr 5, 2016
86a9746
New and improved onchange-nfs.sh script
Apr 6, 2016
4e8e85f
code tweaks to the mu-plugin from @stevegrunwell's code review
Apr 6, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
manta.id_rsa
manta.id_rsa.pub
_env
79 changes: 43 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ RUN a2enmod rewrite

# install the PHP extensions we need, and other packages
RUN apt-get update \
&& apt-get install -y \
&& apt-get install -y --no-install-recommends \
less \
libpng12-dev \
libjpeg-dev \
unzip \
curl \
nfs-common \
libmemcached-dev \
vim \
&& rm -rf /var/lib/apt/lists/* \
&& pecl install memcached \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be consolidated with the section above? See also https://github.com/10up/triton-wordpress/pull/2#discussion_r58458848

&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mysqli opcache
&& docker-php-ext-install gd mysqli opcache \
&& docker-php-ext-enable memcached

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
Expand All @@ -24,18 +30,20 @@ RUN { \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

COPY /bin/docker-entrypoint.sh /entrypoint.sh

# The Containerbuddy helper/glue scripts for this specific app
COPY containerbuddy /opt/containerbuddy
# The our helper/glue scripts and configuration for this specific app
COPY bin /usr/local/bin
COPY etc /etc

# Install Containerbuddy
# Releases at https://github.com/joyent/containerbuddy/releases
ENV CONTAINERBUDDY_VERSION 0.1.1
ENV CONTAINERBUDDY_SHA1 3163e89d4c95b464b174ba31733946ca247e068e
RUN curl --retry 7 -Lso /tmp/containerbuddy.tar.gz "https://github.com/joyent/containerbuddy/releases/download/${CONTAINERBUDDY_VERSION}/containerbuddy-${CONTAINERBUDDY_VERSION}.tar.gz" \
&& echo "${CONTAINERBUDDY_SHA1} /tmp/containerbuddy.tar.gz" | sha1sum -c \
&& tar zxf /tmp/containerbuddy.tar.gz -C /opt/containerbuddy \
# Add Containerbuddy and its configuration
ENV CONTAINERBUDDY_VER 1.3.0
ENV CONTAINERBUDDY file:///etc/containerbuddy.json

RUN export CONTAINERBUDDY_CHECKSUM=c25d3af30a822f7178b671007dcd013998d9fae1 \
&& curl -Lso /tmp/containerbuddy.tar.gz \
"https://github.com/joyent/containerbuddy/releases/download/${CONTAINERBUDDY_VER}/containerbuddy-${CONTAINERBUDDY_VER}.tar.gz" \
&& echo "${CONTAINERBUDDY_CHECKSUM} /tmp/containerbuddy.tar.gz" | sha1sum -c \
&& tar zxf /tmp/containerbuddy.tar.gz -C /usr/local/bin \
&& rm /tmp/containerbuddy.tar.gz

# Install Consul template
Expand All @@ -47,44 +55,43 @@ RUN curl --retry 7 -Lso /tmp/consul-template.zip "https://releases.hashicorp.com
&& unzip /tmp/consul-template.zip -d /usr/local/bin \
&& rm /tmp/consul-template.zip

# Make the WP uploads directory writeable by the web server
#RUN chown -R www-data:www-data /var/www/html/content/uploads

# install wp-cli, http://wp-cli.org
ENV WP_CLI_CONFIG_PATH /var/www/html/wp-cli.yml
RUN curl -Ls -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp \
&& wp --info --allow-root

# copy the WordPress skeleton from this repo into the container
# this includes any themes and/or plugins we've added to the content/themes and content/plugins, etc, directories.
COPY /var/www/html /var/www/html

# Make the WP uploads directory writeable by the web server
RUN chown -R www-data:www-data /var/www/html/content/uploads

# install WordPress
# Releases at https://wordpress.org/download/release-archive/
ENV WORDPRESS_VERSION 4.4.1
ENV WORDPRESS_SHA1 89bcc67a33aecb691e879c818d7e2299701f30e7
# upstream tarballs include ./wordpress/ so this gives us /var/www/html/wordpress
RUN curl -o wordpress.tar.gz -SL https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz \
&& echo "${WORDPRESS_SHA1} *wordpress.tar.gz" | sha1sum -c - \
&& tar -xzf wordpress.tar.gz -C /var/www/html \
&& rm wordpress.tar.gz

ENV WORDPRESS_VERSION 4.4.2
# install WordPress via wp-cli & copy the default themes to our content dir
RUN wp --allow-root core download --version=${WORDPRESS_VERSION} \
&& cp -r /var/www/html/wordpress/wp-content/themes/* /var/www/html/content/themes/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp or mv?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, moving is probably better, at least to keep container size down



# install HyperDB, https://wordpress.org/plugins/hyperdb
# Releases at https://wordpress.org/plugins/hyperdb/developers/ , though no SHA1 fingerprints are published
ENV HYPERDB_VERSION 1.1
RUN curl -Lo /var/www/html/hyperdb.zip https://downloads.wordpress.org/plugin/hyperdb.${HYPERDB_VERSION}.zip \
RUN curl -Ls -o /var/www/html/hyperdb.zip https://downloads.wordpress.org/plugin/hyperdb.${HYPERDB_VERSION}.zip \
&& unzip hyperdb.zip \
&& chown -R www-data:www-data /var/www/html/hyperdb \
&& mv hyperdb/db.php /var/www/html/content/. \
&& rm -rf /var/www/html/hyperdb.zip /var/www/html/hyperdb \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do want to define a volume for most use cases

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, I didn't think we wanted that in here, will readd.

&& touch /var/www/html/wordpress/db-config.php \
&& ln -s /var/www/html/wordpress/db-config.php /var/www/html/.
&& touch /var/www/html/content/db-config.php

# install ztollman's object-cache.php or object caching to memcached
RUN curl -Ls -o /var/www/html/content/object-cache.php https://raw.githubusercontent.com/tollmanz/wordpress-pecl-memcached-object-cache/master/object-cache.php

# install wp-cli, http://wp-cli.org
ENV WP_CLI_CONFIG_PATH /var/www/html/wp-cli.yml
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp \
&& wp --info --allow-root

# the volume is defined after we install everything
VOLUME /var/www/html

# grr, ENTRYPOINT resets CMD now
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]
CMD ["/usr/local/bin/containerbuddy", \
"apache2-foreground"]
41 changes: 41 additions & 0 deletions _env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Environment variables for MySQL service
MYSQL_USER=wpuser
MYSQL_PASSWORD=userpassword
MYSQL_REPL_USER=repluser
MYSQL_REPL_PASSWORD=replpassword
MYSQL_DATABASE=test

# Environment variables for backups to Manta
MANTA_URL=
MANTA_USER=
MANTA_SUBUSER=
MANTA_ROLE=
MANTA_KEY_ID=
MANTA_PRIVATE_KEY=
MANTA_BUCKET=

WORDPRESS_VERSION=4.1
# please include the scheme http:// or https:// in the URL variable
WORDPRESS_URL=http://localhost
WORDPRESS_SITE_TITLE=test site
WORDPRESS_ADMIN_EMAIL=username@domain.com
WORDPRESS_ADMIN_USER=username
WORDPRESS_ADMIN_PASSWORD=password
WORDPRESS_ACTIVE_THEME=theme
WORDPRESS_CACHE_KEY_SALT=some-unique-string
#WORDPRESS_TEST_DATA=False

# Wordpress unique salts - these must be unique for your install to ensure
# login security. visit the following link to generate a set for your site and
# include them here
# https://api.wordpress.org/secret-key/1.1/salt/
WORDPRESS_AUTH_KEY=
WORDPRESS_SECURE_AUTH_KEY=
WORDPRESS_LOGGED_IN_KEY=
WORDPRESS_NONCE_KEY=
WORDPRESS_AUTH_SALT=
WORDPRESS_SECURE_AUTH_SALT=
WORDPRESS_LOGGED_IN_SALT=
WORDPRESS_NONCE_SALT=

CONSUL=consul
164 changes: 0 additions & 164 deletions bin/docker-entrypoint.sh

This file was deleted.

5 changes: 5 additions & 0 deletions bin/health.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

/usr/local/bin/wp --allow-root core is-installed \
&& /usr/local/bin/wp --allow-root option get siteurl \
&& /usr/bin/curl --fail -s -o /dev/null http://localhost/
9 changes: 9 additions & 0 deletions bin/onchange-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

/usr/local/bin/onchange-wp-config.sh

consul-template \
-once \
-dedup \
-consul ${CONSUL}:8500 \
-template "/var/www/html/consul-templates/db-config.php.ctmpl:/var/www/html/content/db-config.php"
7 changes: 7 additions & 0 deletions bin/onchange-memcached.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

consul-template \
-once \
-dedup \
-consul ${CONSUL}:8500 \
-template "/var/www/html/consul-templates/memcached-config.php.ctmpl:/var/www/html/memcached-config.php"
Loading