Skip to content

Commit fabeff4

Browse files
committed
initial commit
0 parents  commit fabeff4

25 files changed

+8091
-0
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!code/themes
3+
!code/plugins
4+
!data/php/multisite.htaccess
5+
!data/php/docker-entrypoint.sh

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.DS_Store
2+
/.htaccess
3+
/code/plugins/akismet
4+
/code/plugins/hello.php
5+
/code/plugins/index.php
6+
/code/tests/shots
7+
/code/themes/**/*.css.map
8+
/code/themes/**/*.js.map
9+
/code/themes/index.php
10+
/code/themes/twenty*
11+
/index.php
12+
/license.txt
13+
/local-config.php
14+
/npm-debug.log
15+
/readme.html
16+
/wp-*.php
17+
/wp-admin
18+
/wp-includes
19+
/xmlrpc.php
20+
data/db/.db
21+
data/nginx/log
22+
data/uploads
23+
data/wordpress*
24+
data/certs
25+
node_modules

Dockerfile

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM php:7.1-apache
2+
# install the PHP extensions we need
3+
RUN set -ex; \
4+
\
5+
apt-get update; \
6+
apt-get install -y \
7+
libjpeg-dev \
8+
libpng-dev \
9+
; \
10+
rm -rf /var/lib/apt/lists/*; \
11+
\
12+
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
13+
docker-php-ext-install gd mysqli opcache
14+
15+
RUN echo 'installing WP-CLI'; \
16+
curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \
17+
chmod +x /usr/local/bin/wp
18+
# TODO consider removing the *-dev deps and only keeping the necessary lib* packages
19+
20+
# set recommended PHP.ini settings
21+
# see https://secure.php.net/manual/en/opcache.installation.php
22+
RUN { \
23+
echo 'opcache.memory_consumption=128'; \
24+
echo 'opcache.interned_strings_buffer=8'; \
25+
echo 'opcache.max_accelerated_files=4000'; \
26+
echo 'opcache.revalidate_freq=2'; \
27+
echo 'opcache.fast_shutdown=1'; \
28+
echo 'opcache.enable_cli=1'; \
29+
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
30+
31+
RUN a2enmod rewrite expires
32+
33+
COPY ./code/themes /var/www/html/wp-content/themes
34+
COPY ./code/plugins /var/www/html/wp-content/plugins
35+
36+
VOLUME /var/www/html
37+
38+
EXPOSE 80
39+
40+
ENV WORDPRESS_VERSION 4.9.1
41+
ENV WORDPRESS_SHA1 5376cf41403ae26d51ca55c32666ef68b10e35a4
42+
43+
RUN set -ex; \
44+
curl -o wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"; \
45+
tar -xzf wordpress.tar.gz -C /usr/src/; \
46+
rm wordpress.tar.gz; \
47+
chown -R www-data:www-data /usr/src/wordpress
48+
49+
COPY ./data/php/multisite.htaccess /usr/src/wordpress/multisite.htaccess
50+
COPY ./data/php/docker-entrypoint.sh /usr/local/bin/
51+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
52+
53+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
54+
CMD ["apache2-foreground"]

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 J Lopes
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Docker wordpress Multisite
2+
-- instructions to follow --
3+
4+
## Creating development SSL certificates
5+
[Using Openssl](https://www.openssl.org/docs/manmaster/man1/openssl-req.html)

code/src/test.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import './test/js/app';
2+
import './test/css/app.css';

code/src/test/css/app.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background-color: #efefef;
3+
}

code/src/test/js/app.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('hello world');

code/themes/test/dist/scripts.min.js

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/themes/test/dist/style.min.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
body{background-color:#efefef}

code/themes/test/footer.php

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
<?php wp_footer(); ?>
3+
</body>
4+
</html>

code/themes/test/functions.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
function theme_scripts() {
3+
$assets = array(
4+
'css' => '/dist/style.min.css',
5+
'js' => '/dist/scripts.min.js',
6+
);
7+
8+
wp_enqueue_style('theme_css', get_template_directory_uri() . $assets['css'], array(), '0.01');
9+
wp_enqueue_script('theme_js', get_template_directory_uri() . $assets['js'], array('jquery'), '0.01', true);
10+
}
11+
12+
add_action('wp_enqueue_scripts', 'theme_scripts', 100);

code/themes/test/header.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<?php wp_head(); ?>
8+
9+
<title>Test Theme</title>
10+
</head>
11+
<body>

code/themes/test/index.php

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
// *** Basic Template *** //
3+
get_header();
4+
?>
5+
<h1>Hello World!</h1>
6+
<?php get_footer(); ?>

code/themes/test/style.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
Theme Name: Test template
3+
Author: This guy
4+
Author URI: http://www.google.com/
5+
*/

data/nginx/default.conf

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
upstream wordpress.local {
2+
server wp:80;
3+
}
4+
5+
server {
6+
listen 80;
7+
index index.php index.html;
8+
server_name wordpress.local;
9+
error_log /var/log/nginx/error.log;
10+
access_log /var/log/nginx/access.log;
11+
root /var/www/html;
12+
13+
location / {
14+
rewrite ^(.*) https://$host$1 permanent;
15+
}
16+
}
17+
18+
server {
19+
listen 443;
20+
server_name wordpress.local;
21+
root /var/www/html;
22+
error_log /var/log/nginx/error.log;
23+
access_log /var/log/nginx/access.log;
24+
25+
index index.php;
26+
27+
client_max_body_size 5m;
28+
29+
location / {
30+
proxy_pass http://wordpress.local;
31+
proxy_set_header X-Forwarded-Proto https;
32+
# try_files $uri $uri/ /index.php?$args;
33+
}
34+
35+
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
36+
37+
ssl on;
38+
39+
ssl_certificate /etc/nginx/certs/nginx-selfsigned.crt;
40+
ssl_certificate_key /etc/nginx/certs/nginx-selfsigned.key;
41+
ssl_dhparam /etc/nginx/certs/dhparam.pem;
42+
}

0 commit comments

Comments
 (0)