Archived
2.1 KiB
2.1 KiB
WordPress Docker Setup
This repository provides a Dockerized environment for running WordPress locally using Docker Compose. It's designed for quick development and testing without complex installations.
Architecture
- Apache Server: Single Apache container with
mod_userdirenabled - User Data: Shared volume containing student org home directories
- WordPress: Separate WordPress + MariaDB containers for testing
- Structure: Each org has
/home/<orgname>/public_html/served athttp://localhost:8080/~<orgname>
🚀 Quick Start
-
Clone the repository:
git clone https://git.1337.berkeley.edu/Committee/Secure-OCF-Web-Hosting.git cd Secure-OCF-Web-Hosting/WordPress-Docker -
Install Docker Desktop:
-
Build and start the containers:
docker-compose up -d -
Access WordPress:
Open your browser and navigate to:
http://localhost:8081Follow the on-screen instructions to complete the WordPress setup.
Access sites:
- Student org sites:
- WordPress: http://localhost:8081
Add new student org:
docker exec -it ocf_apache_server bash
mkdir -p /home/neworg/public_html
echo "<h1>New Org</h1>" > /home/neworg/public_html/index.html
chown -R www-data:www-data /home/neworg
View Apache logs:
docker logs ocf_apache_server
⚙️ Managing Containers
-
Start containers:
docker-compose start -
Stop containers:
docker-compose stop -
Stop and remove containers:
docker-compose downAdd the
-vflag to also remove volumes:docker-compose down -v
🔐 Accessing phpMyAdmin
If phpMyAdmin is included in your setup:
-
Open your browser and navigate to:
http://localhost:8081