This repository contains the setup for a WordPress blog and a MariaDB. Each service runs in its own container. A WordPress admin user and MariaDB user are created via the environment variables. An example.env is provided.
- Docker Engine or Docker Desktop
In order to quickly get started with the project follow these steps:
- Clone the repository
- Navigate to the repository
- Configure required application environment variables
cp example.env .env- Edit the .env file
- Build and run the containers
docker compose up -d
- (Optional) Show container logs
docker compose logs -f
- Verify the application is running by visiting
<your-ip>:8080(or the port you configured in the .env)
- Create (or copy) the .env file to configure the application.
cp example.env .envThe file has to be in the root directory. Otherwise you need to reference it in the docker compose command. 2. Edit the environment variables. Make sure to use strong passwords if the application is exposed to the internet.
You can build and run the containers with a simple command:
# use -d to run the containers in the background
# you can use --env-file /path/to/your/.env if it's not in the root directory
docker compose up -dThis will build and start both containers.
To see the log files of the application, you can use:
docker compose logs -fClosing this terminal will not stop the containers.
If you want to stop the application (and all containers of it) use:
docker compose stopTo start it again:
docker compose startYou can remove the containers with
docker compose downif you don't need them anymore.