Repository navigation
in progress #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in progress #3
Changes from all commits
00a9a0c
b0d2fe7
eb58ebb
9746435
e819ca3
ef22630
4f1e201
02c3b28
1422c57
0e4d512
19159bc
fdb2aed
2f6edbc
6fb103f
81882fc
00798dd
4c4cf9c
2c9db30
110cf3a
fc8944b
05d8824
5bde084
c588382
38c07ea
bc363b5
1eeae3a
16e2c55
01bbf79
4e2a6ee
e4e4456
4045787
97dd89c
e56a3aa
86a9746
4e8e85f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| .DS_Store | ||
| manta.id_rsa | ||
| manta.id_rsa.pub | ||
| _env |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 \ | ||
| && 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 | ||
|
|
@@ -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 | ||
|
|
@@ -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/ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 \ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"] | ||
| 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 |
This file was deleted.
| 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/ |
| 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" |
| 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" |
There was a problem hiding this comment.
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