This project is a Dockerized WordPress infrastructure using three key components: Nginx, MariaDB, and WordPress itself. The containers are orchestrated using Docker Compose, based on custom Docker images built from Dockerfiles. The intention behind this project was to learn about Docker, containerization, and orchestration.
The Nginx container serves as the web server and is exposed on port 443 using a self-signed TLS certificate. MariaDB is used as the database and is configured through a script during the build phase. WordPress is set up using WP CLI, also configured via a script during its build phase.
srcs
├── docker-compose.yml
└── requirements
├── mariadb
│ ├── Dockerfile
| ├── conf
│ └── tools
├── nginx
│ ├── Dockerfile
│ └── conf
└── wordpress
├── Dockerfile
└── tools
- Docker installed
- Docker Compose installed
-
Clone the repository:
git clone https://github.com/Guiribei/Inception.git
-
Navigate to the project directory:
cd Inception -
Start the Docker Compose using Makefile:
make
You can now access the WordPress website at https://localhost.
To configure your setup, you'll need to provide environment variables. You must create a .env file for that.
Here are the variables you may set:
DATABASE_USERDATABASE_USER_PASSWORDDATABASE_NAMEDATABASE_ROOT_PASSWORDWP_ADMIN_USERWP_ADMIN_PASSWDWP_ADMIN_EMAILWP_USERWP_USER_PASSWDWP_USER_EMAILWP_URLWP_DB_HOSTWP_TITLE
The project uses two volumes:
db_datafor MariaDB, mounted at/var/lib/mysqlin the container.wp_datafor WordPress, mounted at/var/www/wordpressin the container.
A custom bridge network (mynetwork) is used for communication between the containers.
This project uses custom Docker images based on Alpine Linux:
- Nginx: Located at
requirements/nginx/Dockerfile. - MariaDB: Located at
requirements/mariadb/Dockerfile. - WordPress: Located at
requirements/wordpress/Dockerfile.
You can modify these Dockerfiles to suit your needs.
