Skip to content

Containers: nginx, 3 php-fpm, mysql, memcached, prometheus, grafana, 5 exporters

Notifications You must be signed in to change notification settings

spmpresto/docker_nginx_php_mysql_load_balancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What is Load Balancer?

68747470733a2f2f692e696d6775722e636f6d2f4a486b6d3568632e706e67

Containers

  • 1 nginx load balancer
  • 3 php-fpm
  • 1 MySQL
  • 1 Memcached
  • 1 Sphinx
  • 1 Prometheus
  • 1 Grafana
  • 1 nginx_exporter
  • 3 php_fpm_exporter
  • 1 mysql_exporter
  • 1 memcached_exporter
  • 1 node-exporter

Exporters for prometheus only for test purposes you can delete/disable it in the files ./_docker/docker-compose.yml and ./configs/prometheus/prometheus.yml

Initial setup:

  1. Go to directory with file docker-compose.yml:
cd _docker
  1. Start the containers:
docker-compose up -d
  1. Once started, run setup1.sh to create the local environment.
./setup1.sh
  1. After setup1.sh executed successfully start setup2.sh:
./setup2.sh

At this point, the container should be available at:

You can change ports in the .env file.

Grafana dashboards of exporters:

How to add Prometheus to Grafana?

How to import Grafana dashboards?

How to generate yoursite.com.chained.crt and server.key?

  1. Generate a private key (server.key)
openssl genrsa -out server.key 2048
  1. Generate CSR (Certificate Signing Request)
openssl req -new -key server.key -out server.csr

When you run the command, you will be prompted to enter the data for the certificate:

  • Country Name (2 letter code): RU, US, etc.
  • State or Province Name: Your region or state
  • Locality Name (e.g., city): City
  • Organization Name (e.g., company): Company name
  • Organizational Unit Name: Department
  • Common Name (e.g., your domain): www.yoursite.com
  • Email Address: [email protected]
  1. Generating a self-signed certificate (chained.crt)
openssl x509 -req -days 365 -in server.csr -signkey server.key -out www.yoursite.com.chained.crt

How to generate .htpasswd ?

Use following command :

htpasswd -c /var/www/domain.com/public_html/.htpasswd user

About

Containers: nginx, 3 php-fpm, mysql, memcached, prometheus, grafana, 5 exporters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published