Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Iseard
Wordpress Docker
Commits
6232adfa
Commit
6232adfa
authored
Sep 09, 2020
by
Michael Iseard
Browse files
Automatically install redis object cache drop in
parent
dd3c162d
Changes
3
Hide whitespace changes
Inline
Side-by-side
.env.example
View file @
6232adfa
...
...
@@ -23,6 +23,9 @@ MYSQL_DATABASE=wordpress
# nginx - nginx:latest
NGINX_VERSION=latest
# redis
REDIS_PASSWORD=changeme
# volumes on host
NGINX_CONF_DIR=./nginx
NGINX_LOG_DIR=./logs/nginx
...
...
build/wordpress/Dockerfile
View file @
6232adfa
...
...
@@ -80,6 +80,9 @@ RUN set ex; \
tar -xzf wordpress.tar.gz -C /usr/src/; \
rm wordpress.tar.gz; \
chown -R www-data:www-data /usr/src/wordpress; \
# install redis object cache
curl -o /usr/src/wordpress/wp-content/object-cache.php https://raw.githubusercontent.com/pantheon-systems/wp-redis/master/object-cache.php; \
#chown -R www-data:www-data /usr/src/wordpress; \
# pre-create wp-content (and single-level children) for folks who want to bind-mount themes, etc so permissions are pre-created properly instead of root:root
mkdir wp-content; \
for dir in /usr/src/wordpress/wp-content/*/; do \
...
...
@@ -87,10 +90,7 @@ RUN set ex; \
mkdir "wp-content/$dir"; \
done; \
chown -R www-data:www-data wp-content; \
chmod -R 777 wp-content
VOLUME
/var/www/html
chmod -R 777 wp-content;
COPY
docker-entrypoint.sh /usr/local/bin/
...
...
docker-compose.yml
View file @
6232adfa
...
...
@@ -52,6 +52,7 @@ services:
-
db
volumes
:
-
${WORDPRESS_DIR:-./wordpress}:/var/www/html/
-
./object-cache.php:/var/www/html/wp-content/object-cache.php
-
${PHP_UPLOADS:-./php/uploads.ini}:/usr/local/etc/php/conf.d/uploads.ini
environment
:
WORDPRESS_DB_NAME
:
${MYSQL_DATABASE:-wordpress}
...
...
@@ -61,6 +62,13 @@ services:
WORDPRESS_DB_PASSWORD
:
${MYSQL_PASSWORD:-password}
WORDPRESS_CONFIG_EXTRA
:
|
define('FS_METHOD', 'direct');
$$redis_server = array(
'host' => 'redis',
'port' => 6379,
'auth' => '2ihJHjk45ff',
'database' => 0, // Optionally use a specific numeric Redis database. Default is 0.
);
restart
:
always
nginx
:
...
...
@@ -102,7 +110,7 @@ services:
redis
:
image
:
redis:alpine
container_name
:
${CONTAINER_PREFIX}-redis
command
:
redis-server --requirepass ${REDIS_PASSWORD}
restart
:
always
networks
:
-
default
-
web
ports
:
-
6379:6379
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment