Skip to content

Commit

Permalink
Added Customise WordPress on Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Nov 2, 2019
1 parent dd449f5 commit 79c612d
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

This repository is a dump for code snippets and samples that in use by the articles at my website [The Developer's Tidbits - Helpful tips for random problems](https://www.devtidbits.com/).

- `post_5017`

- _[Customise WordPress on Docker](https://devtidbits.com/?p=5017)_

- `post_3905`

- _[Run Ubuntu 16.04 on Windows 10 Creators Update](https://devtidbits.com/2017/06/08/run-ubuntu-16-04-on-windows-10-creators-update/)_
Expand Down
67 changes: 67 additions & 0 deletions post_5017/example.com/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: "3.7"

services:
wordpress:
image: wordpress
labels:
- "com.example.description=Example WordPress site"
restart: always
ports:
- target: 80
published: 8080
protocol: tcp
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: myblogdb
WORDPRESS_DB_USER: wpinternal
WORDPRESS_DB_PASSWORD: stencil-running-cargo-savage
WORDPRESS_CONFIG_EXTRA: |
# Require SSL for admin and logins
define( 'FORCE_SSL_ADMIN', false );
# Disable plugin and theme update and installation
define( 'DISALLOW_FILE_MODS', false );
# Disable the plugin and theme editor
define( 'DISALLOW_FILE_EDIT', false );
volumes:
- type: volume
source: wordpress
target: /var/www/html
- type: bind
source: ./docker-uploads.ini
target: /usr/local/etc/php/conf.d/docker-uploads.ini
- type: bind
source: ./docker-servername.conf
target: /etc/apache2/conf-enabled/docker-servername.conf

db:
image: mysql:5.7
labels:
- "com.example.description=Example WordPress database"
restart: always
environment:
MYSQL_DATABASE: myblogdb
MYSQL_USER: wpinternal
MYSQL_PASSWORD: stencil-running-cargo-savage
MYSQL_RANDOM_ROOT_PASSWORD: "1"
volumes:
- type: volume
source: db
target: /var/lib/mysql
- type: bind
source: ./docker-fixes.cnf
target: /etc/mysql/conf.d/docker-fixes.cnf
adminer:
image: adminer
restart: always
ports:
- target: 8080
published: 8070
protocol: tcp

volumes:
wordpress:
labels:
- "com.example.description=WordPress install"
db:
labels:
- "com.example.description=MySQL datastore"
2 changes: 2 additions & 0 deletions post_5017/example.com/docker-fixes.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mysqld]
explicit_defaults_for_timestamp=on
2 changes: 2 additions & 0 deletions post_5017/example.com/docker-servername.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Hostname and port that the server uses to identify itself
ServerName localhost
8 changes: 8 additions & 0 deletions post_5017/example.com/docker-uploads.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Allow HTTP file uploads
file_uploads = On

# Maximum size of an uploaded file
upload_max_filesize = 64M

# Maximum size of form post data
post_max_size = 64M

0 comments on commit 79c612d

Please sign in to comment.