-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.wordpress
44 lines (35 loc) · 1.11 KB
/
Dockerfile.wordpress
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM wordpress:5.7.2-php7.4-apache
# Base packages
RUN apt-get update && \
apt-get install -y --no-install-recommends ssl-cert \
mariadb-client \
libpng-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libwebp-dev \
zlib1g-dev \
less \
libjpeg-progs \
jpegoptim \
optipng \
webp \
unzip \
zip \
git
# Cleanup
RUN rm -r /var/lib/apt/lists/*
# Install binaries from other images, WP CLI, Composer
COPY --from=wordpress:cli-2.4-php7.4 /usr/local/bin/wp /usr/local/bin/wp
COPY --from=composer:2.0.11 /usr/bin/composer /usr/bin/composer
# Use the production config
RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Copy extra configs/overrides
COPY ./conf/php /tmp/conf
RUN mv /tmp/conf/* "$PHP_INI_DIR/conf.d"
# Enable SSL
RUN a2enmod ssl && \
a2ensite default-ssl
WORKDIR /var/www/html
COPY --chown=www-data:www-data ./wp-content/plugins /var/www/html/wp-content/plugins
COPY --chown=www-data:www-data ./wp-content/themes /var/www/html/wp-content/themes
RUN chown -R www-data:www-data /var/www