Created
June 13, 2019 10:41
-
-
Save karlisabele/16c0ccc52bdf34bee5f201ac7a0c45f7 to your computer and use it in GitHub Desktop.
WP plugins and themes pre-installed on docker image
This file contains hidden or 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
FROM wordpress:php7.1-apache | |
### This is where you copy all the plugins and themes to the corresponding folders | |
COPY my-theme /themes/my-theme | |
COPY my-plugin /plugins/my-plugin | |
COPY entrypoint.sh /usr/bin/entrypoint | |
RUN chmod +x /usr/bin/entrypoint | |
ENV PROJECT_ROOT=/var/www/html THEME_FOLDER=/themes PLUGIN_FOLDER=/plugins | |
ENTRYPOINT ["entrypoint"] | |
CMD ["apache2-foreground"] |
This file contains hidden or 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
#!/usr/bin/env sh | |
set -xe | |
THEME_FOLDER=${THEME_FOLDER:-/themes} | |
PLUGIN_FOLDER=${PLUGIN_FOLDER:-/plugins} | |
PROJECT_ROOT=${PROJECT_ROOT:-/var/www/html} | |
for themeDir in `find ${THEME_FOLDER}/* -type d` | |
do | |
themeName=$(basename ${themeDir}) | |
ln -s "$themeDir" "${PROJECT_ROOT}/wp-content/themes/$themeName" | |
done | |
for pluginDir in `find ${PLUGIN_FOLDER}/* -type d` | |
do | |
pluginName=$(basename ${pluginDir}) | |
ln -s "$pluginDir" "${PROJECT_ROOT}/wp-content/plugins/$pluginName" | |
done | |
docker-entrypoint.sh "$@" |
This file contains hidden or 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
version: "3" | |
services: | |
php: | |
image: test | |
volumes: | |
- ./wordpress:/var/www/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!