This repository provides a complete setup for a PrestaShop development environment using Docker. The setup includes multiple components including MySQL, PrestaShop, Loki, Promtail, and Grafana for log analysis.
At the end, when everything is running you should have this:
- Ensure you have Docker and Docker Compose installed on your machine.
- Download a version of Prestashop and update the Dockerfile.devel
- Create necessary folders for Grafana, Loki,...
-
Clone this repository.
-
Customize
Dockerfile.devel
to install a different version of PrestaShop or other dependencies if needed. -
Build the Docker images using the provided
docker.sh
script:./docker.sh build
-
Start the development environment:
./docker.sh up
The base container is set up with OpenSSH server and allows SSH access using public key authentication. Ensure your public key is added to the container.
This Dockerfile sets up the base container with all necessary dependencies and tools except PrestaShop. It includes configurations for PHP, SSH, and other essential tools.
This Dockerfile sets up the development container, adding PrestaShop and other necessary configurations for a development environment.
This file defines the services and configurations for Docker Compose, including the PrestaShop service, MySQL database, Loki, Promtail, and Grafana for log analysis.
This setup includes Grafana for visualizing logs and Loki as a log aggregation system. Promtail is used to collect logs from various sources.
- MySQL: Database service for PrestaShop.
- PrestaShop: The main application service.
- Loki: A log aggregation system.
- Promtail: An agent that ships the contents of the logs to Loki.
- Grafana: A platform for monitoring and observability.
- Grafana is available at
http://localhost:3000
. - Default authentication is disabled, and anonymous access is enabled with Admin role. You can customize this in the
docker-compose.yml
file if needed. - Logs from Apache and PrestaShop are collected and displayed in Grafana dashboards.
- loki-config.yaml: Configuration for Loki.
- promtail-config.yml: Configuration for Promtail to specify which logs to collect and ship to Loki.
-
Start the stack using Docker Compose:
docker-compose up -d
-
Access Grafana at
http://localhost:3000
to start visualizing your logs.
config/
: Contains configuration files for MySQL and other services.init-scripts/
: Initialization scripts for setting up the environment.logs/
: Directory to store logs from Apache and PrestaShop.modules/
: Custom PrestaShop modules for development.grafana/
: Persistent storage for Grafana configurations and dashboards.provisioning/
: Grafana provisioning configuration for data sources and dashboards.
To build and run the Docker containers:
./docker.sh build
./docker.sh up
- Ensure your public SSH key is correctly added to the configuration for SSH access.
- Adjust any environment variables as necessary in the
docker-compose.yml
file.