forked from bozdoz/wp-plugin-leaflet-map
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benjamin J. DeLong
committed
Jul 17, 2018
1 parent
ee13546
commit f4c1b36
Showing
5 changed files
with
148 additions
and
39 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,41 @@ | ||
FROM php:7.2-alpine | ||
|
||
MAINTAINER @bozdoz | ||
|
||
# install the PHP extensions we need for WP-CLI | ||
RUN set -ex; \ | ||
\ | ||
apk add --no-cache --virtual .build-deps \ | ||
libjpeg-turbo-dev \ | ||
libpng-dev \ | ||
; \ | ||
\ | ||
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \ | ||
docker-php-ext-install gd mysqli opcache zip; \ | ||
\ | ||
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 | ||
|
||
RUN set -ex; \ | ||
mkdir -p /var/www/html; \ | ||
chown -R www-data:www-data /var/www/html | ||
|
||
WORKDIR /var/www/html | ||
VOLUME /var/www/html | ||
|
||
RUN curl -L https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > /usr/bin/wp && \ | ||
chmod +x /usr/bin/wp | ||
|
||
ENV WORDPRESS_PORT 1234 | ||
|
||
COPY docker-install.sh /usr/local/bin/ | ||
|
||
RUN chmod 755 /usr/local/bin/docker-install.sh | ||
|
||
CMD [ "docker-install.sh" ] |
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,43 @@ | ||
version: '3.3' | ||
|
||
services: | ||
db: | ||
image: mariadb | ||
volumes: | ||
- wp_db:/var/lib/mysql | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: rootpass | ||
MYSQL_DATABASE: wordpress | ||
MYSQL_USER: wordpress | ||
MYSQL_PASSWORD: wordpress | ||
|
||
wordpress: | ||
image: wordpress:latest | ||
depends_on: | ||
- db | ||
volumes: | ||
- wordpress:/var/www/html | ||
- .:/var/www/html/wp-content/plugins/leaflet-map | ||
ports: | ||
- 1234:80 | ||
restart: always | ||
environment: | ||
WORDPRESS_DB_HOST: db:3306 | ||
WORDPRESS_DB_NAME: wordpress | ||
WORDPRESS_DB_USER: wordpress | ||
WORDPRESS_DB_PASSWORD: wordpress | ||
|
||
cli: | ||
build: . | ||
depends_on: | ||
- wordpress | ||
volumes: | ||
- wordpress:/var/www/html | ||
- .:/var/www/html/wp-content/plugins/leaflet-map | ||
environment: | ||
WORDPRESS_PORT: 1234 | ||
|
||
volumes: | ||
wp_db: | ||
wordpress: |
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,24 @@ | ||
#!/bin/sh | ||
set -euo pipefail | ||
|
||
if [[ -f wp-config.php && -f .cli-initialized ]]; then | ||
exit 0 | ||
fi | ||
|
||
if [ ! -f wp-config.php ]; then | ||
echo "WordPress not found in $PWD!" | ||
( set -x; ls -A; sleep 15 ) | ||
fi | ||
|
||
if [ ! -f .cli-initialized ]; then | ||
echo "Initializing WordPress install!" | ||
wp --allow-root core install --url="localhost:$WORDPRESS_PORT" --title="Test Leaflet Map" --admin_user=admin --admin_password=password [email protected] --skip-email | ||
|
||
wp --allow-root config set WP_DEBUG true --raw | ||
|
||
wp --allow-root plugin activate leaflet-map | ||
|
||
wp --allow-root post create --post_type=post --post_title='Test Map' --post_content='[leaflet-map] [leaflet-marker]' --post_status='publish' | ||
|
||
touch .cli-initialized | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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