Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 5 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,13 @@ services:
context: ./services/wordpress
args:
ALPINE_VERSION: ${ALPINE_VERSION}
WORDPRESS_VERSION: ${WORDPRESS_VERSION}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
W3_TOTAL_CACHE_VERSION: ${W3_TOTAL_CACHE_VERSION}
volumes:
- code:/code
command: sh -c "test -f /code/index.php ||
(set -ex;
curl -o wordpress.tar.gz -fSL \"https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz\";
tar -xzf wordpress.tar.gz --strip-components=1 -C /code;
rm wordpress.tar.gz;
cp /code/wp-config-sample.php /code/wp-config.php;
sed -i \"s/database_name_here/${MYSQL_DATABASE}/g\" /code/wp-config.php;
sed -i \"s/localhost/mysql/g\" /code/wp-config.php;
sed -i \"s/username_here/${MYSQL_USER}/g\" /code/wp-config.php;
sed -i \"s/password_here/${MYSQL_PASSWORD}/g\" /code/wp-config.php;
curl -o w3-total-cache.zip -fSL \"https://downloads.wordpress.org/plugin/w3-total-cache.${W3_TOTAL_CACHE_VERSION}.zip\";
unzip w3-total-cache.zip -d /code/wp-content/plugins/;
rm w3-total-cache.zip;
curl -o /code/wp-admin/wp-cli.phar -fSL \"https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar\";
chown -R www-data:www-data /code;)"

exim:
container_name: ${DOMAIN}_exim
Expand Down
26 changes: 24 additions & 2 deletions services/wordpress/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,30 @@ FROM alpine:${ALPINE_VERSION}

RUN apk add --no-cache curl

VOLUME /code

ARG WORDPRESS_VERSION
ARG MYSQL_DATABASE
ARG MYSQL_USER
ARG MYSQL_PASSWORD
ARG W3_TOTAL_CACHE_VERSION
RUN set -ex; \
curl -o wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"; \
tar -xzf wordpress.tar.gz --strip-components=1 -C /code; \
rm wordpress.tar.gz; \
cp /code/wp-config-sample.php /code/wp-config.php; \
sed -i "s/database_name_here/${MYSQL_DATABASE}/g" /code/wp-config.php; \
sed -i "s/localhost/mysql/g" /code/wp-config.php; \
sed -i "s/username_here/${MYSQL_USER}/g" /code/wp-config.php; \
sed -i "s/password_here/${MYSQL_PASSWORD}/g" /code/wp-config.php; \
curl -o w3-total-cache.zip -fSL "https://downloads.wordpress.org/plugin/w3-total-cache.${W3_TOTAL_CACHE_VERSION}.zip"; \
unzip w3-total-cache.zip -d /code/wp-content/plugins/; \
rm w3-total-cache.zip; \
curl -o /code/wp-admin/wp-cli.phar -fSL "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar";

RUN set -x ; \
addgroup -g 82 -S www-data ; \
adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1
addgroup -g 82 -S www-data; \
adduser -u 82 -D -S -G www-data www-data; \
chown -R www-data:www-data /code

WORKDIR /code