diff --git a/README.md b/README.md index 1da00c8..a4daf83 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -This directory will contain several configuration files for the deployment of wordpress sites using docker \ No newline at end of file +This directory will contain several configuration files for the deployment of wordpress sites using docker +The subdirectories represent different wordpress deployment: +- basic: MySQL and WordPress containers only +- myadmin: MySQL, WordPress and phpMyAdmin containers +- basic_redis: added redis container to basic +- myadmin_redis: added redis container to myadmin + diff --git a/basic/.env_default b/basic/.env_default index 0374f7d..a3c1c98 100644 --- a/basic/.env_default +++ b/basic/.env_default @@ -1,4 +1,4 @@ -$CONTAINER_NAME=TheNameOfYourContainer +CONTAINER_NAME=TheNameOfYourContainer MYSQL_ROOT_PASSWORD=YourMySQLRootPasswordHere MYSQL_USER=wpuser MYSQL_PASSWORD=The_wpuser_password_here diff --git a/basic/README.md b/basic/README.md index b1aa057..08e8c62 100644 --- a/basic/README.md +++ b/basic/README.md @@ -2,7 +2,16 @@ INSTRUCTIONS 1. Copy (and edit) .env_default to .env 2. Run docker-compose -3. Access the system in hostname:$EX_PORT +3. Access the system in http://hostname:$EX_PORT 4. Follow the system instructions to install WP 5. Have fun! +.env VARIABLES + +The variables in the .env file are: +CONTAINER_NAME: represents the sufix of the containers created +MYSQL_ROOT_PASSWORD: the root password for the MySQL database +MYSQL_USER: the user to own the wordpress database +MYSQL_PASSWORD: the password for the MYSQL_USER +MYSQL_WP_DATABASE: the wordpress database name +EX_PORT: the port to access the wordpress diff --git a/basic/docker-compose.yml b/basic/docker-compose.yml index 5dd9dc8..7a01f6f 100644 --- a/basic/docker-compose.yml +++ b/basic/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: db: image: mysql:8.0 - container_name: $CONTAINER_NAME_db + container_name: "${CONTAINER_NAME}_db" restart: unless-stopped env_file: .env environment: @@ -16,7 +16,7 @@ services: depends_on: - db image: wordpress - container_name: $CONTAINER_NAME_wp + container_name: "${CONTAINER_NAME}_wp" restart: unless-stopped env_file: .env ports: diff --git a/myadmin/.env_default b/myadmin/.env_default new file mode 100644 index 0000000..0c83a56 --- /dev/null +++ b/myadmin/.env_default @@ -0,0 +1,8 @@ +CONTAINER_NAME=TheNameOfYourContainer +MYSQL_ROOT_PASSWORD=YourMySQLRootPasswordHere +MYSQL_USER=wpuser +MYSQL_PASSWORD=The_wpuser_password_here +MYSQL_WP_DATABASE=wordpressdb +EX_PORT=8000 +MY_PORT=8100 + diff --git a/myadmin/README.md b/myadmin/README.md new file mode 100644 index 0000000..85a340a --- /dev/null +++ b/myadmin/README.md @@ -0,0 +1,20 @@ +INSTRUCTIONS + +1. Copy (and edit) .env_default to .env +2. Run docker-compose +3. Access the system in https://hostname:$EX_PORT +4. Follow the system instructions to install WP +5. Have fun! + +If you need to access the phpMyAdmin just point your browser to http://hostname:$MY_PORT + +.env VARIABLES + +The variables in the .env file are: +CONTAINER_NAME: represents the sufix of the containers created +MYSQL_ROOT_PASSWORD: the root password for the MySQL database +MYSQL_USER: the user to own the wordpress database +MYSQL_PASSWORD: the password for the MYSQL_USER +MYSQL_WP_DATABASE: the wordpress database name +EX_PORT: the port to access the wordpress +MY_PORT: the port to access the phpMyAdmin diff --git a/myadmin/docker-compose.yml b/myadmin/docker-compose.yml new file mode 100644 index 0000000..bce5994 --- /dev/null +++ b/myadmin/docker-compose.yml @@ -0,0 +1,44 @@ +version: '3' + +services: + db: + image: mysql:8.0 + container_name: "${CONTAINER_NAME}_db" + restart: unless-stopped + env_file: .env + environment: + - MYSQL_DATABASE=$MYSQL_WP_DATABASE + volumes: + - ./dbdata:/var/lib/mysql + command: '--default-authentication-plugin=mysql_native_password' + + wordpress: + depends_on: + - db + image: wordpress + container_name: "${CONTAINER_NAME}_wp" + restart: unless-stopped + env_file: .env + ports: + - $EX_PORT:80 + environment: + - WORDPRESS_DB_HOST=db:3306 + - WORDPRESS_DB_USER=$MYSQL_USER + - WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD + - WORDPRESS_DB_NAME=$MYSQL_WP_DATABASE + volumes: + - ./wordpress:/var/www/html + + phpmyadmin: + depends_on: + - db + image: phpmyadmin/phpmyadmin + container_name: "${CONTAINER_NAME}_myadmin" + restart: unless-stopped + ports: + - $MY_PORT:80 + env_file: .env + environment: + MYSQL_USER: $MYSQL_USER + MYSQL_PASSWORD: $MYSQL_PASSWORD + MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD