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
8d33f988
Commit
8d33f988
authored
Sep 09, 2020
by
Michael Iseard
Browse files
Add various image compression libraries
parent
537fc04e
Changes
2
Hide whitespace changes
Inline
Side-by-side
build/wordpress/Dockerfile
View file @
8d33f988
...
...
@@ -8,37 +8,42 @@ RUN apk add --no-cache \
bash
\
sed
\
ghostscript
\
imagemagick
imagemagick
\
# image optimization
optipng \
libjpeg-turbo-utils \
gifsicle
# install the PHP extensions we need
RUN
apk add
--no-cache
--virtual
.build-deps
\
RUN
set
-ex
;
\
\
apk add
--no-cache
--virtual
.build-deps
\
$PHPIZE_DEPS
\
freetype-dev
\
imagemagick-dev
\
libjpeg-turbo-dev
\
libpng-dev
\
libzip-dev
\
icu-dev
# libxml2-dev
# install and enable redis and imagmagick
RUN
pecl
install
redis imagick
\
&&
docker-php-ext-enable redis imagick
# more extensions
RUN
docker-php-ext-install
-j
"
$(
nproc
)
"
\
; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
exif \
gd \
mysqli \
zip
# final dependencies
RUN
runDeps
=
"
$(
\
scanelf
--needed
--nobanner
--format
'%n#p'
--recursive
/usr/local/lib/php/extensions
\
|
tr
','
'\n'
\
|
sort
-u
\
|
awk
'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }'
\
zip \
; \
pecl install redis imagick; \
docker-php-ext-enable redis imagick; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n
#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .wordpress-phpexts-rundeps $runDeps; \
apk del .build-deps
...
...
@@ -82,7 +87,6 @@ RUN set ex; \
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 \
...
...
docker-compose.yml
View file @
8d33f988
...
...
@@ -17,28 +17,12 @@ services:
-
web
-
default
labels
:
-
traefik.enable=
fals
e
-
traefik.enable=
tru
e
-
traefik.docker.network=web
-
traefik.http.routers.${CONTAINER_PREFIX}-adminer.rule=Host(`${ADMINER_HOST}`)
-
traefik.http.routers.${CONTAINER_PREFIX}-adminer.tls.certresolver=cloudflare
-
traefik.http.routers.${CONTAINER_PREFIX}-adminer.entrypoints=web-secure
yarn
:
image
:
node:10-alpine
container_name
:
${CONTAINER_PREFIX}-yarn
volumes
:
-
./wordpress/wp-content/themes/wisselenergie-theme/:/app
working_dir
:
/app
command
:
[
"
yarn"
]
composer
:
image
:
composer:1.9.0
container_name
:
${CONTAINER_PREFIX}-composer
volumes
:
-
./wordpress/wp-content/themes/wisselenergie-theme/:/app
depends_on
:
-
wordpress
wordpress
:
build
:
context
:
./build/wordpress
...
...
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