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_USER
DATABASE_USER_PASSWORD
DATABASE_NAME
DATABASE_ROOT_PASSWORD
WP_ADMIN_USER
WP_ADMIN_PASSWD
WP_ADMIN_EMAIL
WP_USER
WP_USER_PASSWD
WP_USER_EMAIL
WP_URL
WP_DB_HOST
WP_TITLE
The project uses two volumes:
db_data
for MariaDB, mounted at/var/lib/mysql
in the container.wp_data
for WordPress, mounted at/var/www/wordpress
in 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.