add redis & rabbitmq

This commit is contained in:
ddadmin 2024-05-19 16:36:01 +03:00
parent b34bef63ca
commit 1af8160473
6 changed files with 107 additions and 1 deletions

6
.env
View File

@ -21,3 +21,9 @@ MAIL_PASSWORD=NRTk7rXhesHQpi3YWB92
MAIL_ENCRYPTION=ssl
MAIL_FROM=no_reply@dot-dot.ru
MAIL_FROM_NAME="No Reply"
RABBITMQ_USERNAME=ddadmin
RABBITMQ_PASSWORD=Utahth9aeshahgh3saik
REDIS_USERNAME=ddadmin
REDIS_PASSWORD=Utahth9aeshahgh3saik

View File

@ -80,7 +80,7 @@ server {
try_files $uri @rewriteapp;
}
location ~* \/admin\/.*(js|jpg|png|css|woff|woff2)$ {
location ~* \/admin\/.*(js|jpg|png|css|woff|woff2)$ {
proxy_pass http://static;
}
@ -170,4 +170,21 @@ server {
proxy_http_version 1.1;
proxy_pass http://mysqld-exporter:9104/metrics;
}
location /redis_exporter {
access_log /var/log/nginx/mysql_exporter_access.log json;
error_log /var/log/nginx/mysql_exporter_error.log;
#if ($allow = 0) {
# return 403;
#}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass http://redis-exporter:9121/metrics;
}
}

View File

@ -0,0 +1,48 @@
server {
listen 80;
server_name rabbitmq.dot-dot.ru;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name rabbitmq.dot-dot.ru;
access_log /var/log/nginx/rabbitmq.wwater.ru_access.log json;
error_log /var/log/nginx/rabbitmq.wwater.ru_error.log;
ssl_certificate /etc/nginx/ssl/dot2023.crt;
ssl_certificate_key /etc/nginx/ssl/dot2023.key;
proxy_buffer_size 128k;
proxy_buffers 4 128k;
client_body_buffer_size 32k;
client_header_buffer_size 256k;
large_client_header_buffers 4 256k;
location / {
client_max_body_size 600m;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://rabbitmq:15672;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
}
location /metrics {
client_max_body_size 600m;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://rabbitmq:15692/metrics;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
}
}

View File

@ -0,0 +1 @@
[rabbitmq_management,rabbitmq_prometheus].

0
configs/redis/redis.conf Normal file
View File

View File

@ -7,6 +7,8 @@ volumes:
mysql_backup_volume:
php_var_volume:
bookstack_data_volume:
rabbitmq_volume:
redis_volume:
networks:
@ -160,4 +162,36 @@ services:
networks:
- dd
rabbitmq:
image: rabbitmq:3.12.1-management-alpine
restart: unless-stopped
hostname: ${COMPOSE_PROJECT_NAME}
volumes:
- rabbitmq_volume:/var/lib/rabbitmq
- ./configs/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USERNAME}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
- RABBITMQ_CONFIG_FILE=/etc/rabbitmq/rabbitmq.conf
networks:
dd: {}
redis:
image: redis:7.2.4-alpine3.19
restart: unless-stopped
volumes:
- redis_volume:/data
- ./configs/redis:/usr/local/etc/redis
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_PORT=6379
networks:
dd: {}
redis-exporter:
image: oliver006/redis_exporter:v1.59.0
command:
- "--redis.addr=redis://redis:6379"
- "--redis.password=${REDIS_PASSWORD}"
networks:
dd: {}