This repository contains a Docker Compose configuration file for running the Grav CMS with Nginx and PHP 8.0 FPM.
- Docker Engine installed
- Docker Compose installed
-
Clone this repository:
git clone https://github.com/your_username/grav-nginx-php8.git
-
Change into the cloned directory: cd grav-nginx-php8
-
Edit the db service environment variables in the docker-compose.yml file to set your desired MySQL/MariaDB root password and username: db:
image: mariadb:latest
container_name: grav-mariadb
restart: always
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=your_password
- MYSQL_DATABASE=grav
- MYSQL_USER=grav
- MYSQL_PASSWORD=your_password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 5
-
Run the docker-compose up command to start the containers: docker-compose up -d
-
Access the Grav CMS at http://localhost.
- The web service is an Nginx web server that listens on port 80 and serves static content from the html directory.
- The app service runs PHP 8.0 FPM and serves the Grav CMS application. The PHP configuration can be edited in the php.ini file.
- The db service runs a MySQL/MariaDB database server and stores data in the db directory.
This project is licensed under the MIT License.