diff --git a/.env b/.env new file mode 120000 index 0000000..b7edcd1 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +wordpress.conf \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7e91d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/wordpress.conf diff --git a/README.md b/README.md new file mode 100644 index 0000000..c0f7022 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# wordpress docker compose + +## info +- https://hub.docker.com/_/wordpress/ diff --git a/data/conf/mysql/docker.cnf b/data/conf/mysql/docker.cnf new file mode 100644 index 0000000..4f1829d --- /dev/null +++ b/data/conf/mysql/docker.cnf @@ -0,0 +1,3 @@ +[mysqld] +skip-host-cache +skip-name-resolve diff --git a/data/conf/mysql/mysql.cnf b/data/conf/mysql/mysql.cnf new file mode 100644 index 0000000..56a15ee --- /dev/null +++ b/data/conf/mysql/mysql.cnf @@ -0,0 +1,13 @@ +[mysqld] +character-set-client-handshake = FALSE +character-set-server = utf8mb4 +collation-server = utf8mb4_unicode_ci +innodb_file_per_table = TRUE +innodb_file_format = barracuda +innodb_large_prefix = TRUE + +[client] +default-character-set = utf8mb4 + +[mysql] +default-character-set = utf8mb4 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7c51a4d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,60 @@ +version: '2.1' + +services: + wordpress-app: + image: wordpress:4.9-php7.2-fpm + restart: always + mem_limit: 1g + depends_on: + - typo3-database + environment: + - TZ=${TZ} + - WORDPRESS_DB_HOST=db + - WORDPRESS_DB_USER=wordpress + - WORDPRESS_DB_USER=${WORDPRESS_DATABASE_PASSWORD} + - WORDPRESS_DB_NAME=wordpress + - WORDPRESS_AUTH_KEY=${WORDPRESS_AUTH_KEY} + - WORDPRESS_LOGGED_IN_KEY=${WORDPRESS_LOGGED_IN_KEY} + - WORDPRESS_AUTH_SALT=${WORDPRESS_AUTH_SALT} + - WORDPRESS_LOGGED_IN_SALT=${WORDPRESS_LOGGED_IN_SALT} + volumes: + - ./data/app: + ports: + - "${WORDPRESS_WEB_BIND:-127.0.0.1}:${WORDPRESS_WEB_PORT:-8080}:80" + links: + - typo3-database:db + networks: + wordpress-network: + aliases: + - app + + wordpress-database: + image: mariadb:10.2 + restart: always + mem_limit: 1g + command: mysqld --skip-name-resolve --skip-host-cache --log-warnings=0 + environment: + - MYSQL_ROOT_PASSWORD=${WORDPRESS_DATABASE_ROOT} + - MYSQL_DATABASE=wordpress + - MYSQL_USER=wordpress + - MYSQL_PASSWORD=${WORDPRESS_DATABASE_PASSWORD} + - TZ=${TZ} + volumes: + - wordpress-db-vol-1:/var/lib/mysql/ + - ./data/conf/mysql:/etc/mysql/conf.d/:ro + tmpfs: + - /tmp + networks: + wordpress-network: + aliases: + - mysql + +networks: + wordpress-network: + driver: bridge + enable_ipv6: false + ipam: + driver: default + +volumes: + wordpress-db-vol-1: diff --git a/generate_password.sh b/generate_password.sh new file mode 100755 index 0000000..9f109c1 --- /dev/null +++ b/generate_password.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ ! -f "wordpress.conf" ]; then + cp wordpress.con.example wordpress.conf + + pw1=$(