Skip to content

Commit e058a9f

Browse files
committed
update mysql to 8.4 with config; added examples for additional services redis and rabbitmq; changed php base image; separated compose config to common
1 parent 304ea1b commit e058a9f

File tree

17 files changed

+446
-66
lines changed

17 files changed

+446
-66
lines changed

.docker/mysql/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
ARG MYSQL_IMAGE_VERSION
22

3-
FROM mysql:${MYSQL_IMAGE_VERSION}
3+
FROM mysql:${MYSQL_IMAGE_VERSION:-8.4}
44

5-
RUN mkdir -p /var/log/mysql && chmod 777 /var/log/mysql
5+
RUN <<EOT sh
6+
mkdir -p /var/log/mysql
7+
chown -R mysql:mysql /var/log/mysql
8+
EOT
69

710
COPY ./config/custom.cnf /etc/mysql/conf.d/custom.cnf

.docker/mysql/config/custom.cnf

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
[mysqld]
2-
default_authentication_plugin=caching_sha2_password
2+
; The default_authentication_plugin=caching_sha2_password is default in 8.4 and should be removed
33
character_set_server=utf8mb4
44
collation_server=utf8mb4_0900_as_cs
55
innodb_lock_wait_timeout=60
66
innodb_rollback_on_timeout=ON
7+
innodb_buffer_pool_size=1024M
78
sort_buffer_size=1024K
89
max_connections=15
910
max_allowed_packet=128M
10-
performance_schema=off
11+
performance_schema=OFF
12+
log_bin=ON
13+
binlog_expire_logs_seconds=864000
1114
log_output=FILE
12-
log_queries_not_using_indexes=1
13-
log_slow_admin_statements=1
14-
log_error=/var/log/mysql/error.log
15-
general_log_file=/var/log/mysql/mysql.log
1615
general_log=1
16+
general_log_file=/var/log/mysql/mysql.log
17+
log_error=/var/log/mysql/error.log
1718
slow_query_log=1
1819
slow_query_log_file=/var/log/mysql/mysql-slow.log
19-
long_query_time=1
20+
long_query_time=1
21+
log_queries_not_using_indexes=ON
22+
log_slow_admin_statements=ON

.docker/mysql/init/.gitkeep

Whitespace-only changes.

.docker/nginx/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG NGINX_IMAGE_VERSION
22

3-
FROM nginx:${NGINX_IMAGE_VERSION}
3+
FROM nginx:${NGINX_IMAGE_VERSION:-1.27}
44

55
COPY ./config/default.conf /etc/nginx/conf.d/default.conf

.docker/php/Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

.docker/rabbitmq/enabled_plugins

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[rabbitmq_management,rabbitmq_management_agent,rabbitmq_shovel,rabbitmq_shovel_management].

.docker/rabbitmq/rabbitmq.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
vm_memory_high_watermark.relative = 0.7
2+
vm_memory_high_watermark_paging_ratio = 0.8
3+
log.file = rabbit.log
4+
log.dir = /var/log/rabbitmq
5+
log.default.level = error
6+
log.file.level = debug
7+
log.connection.level = info
8+
# rotate when the file reaches 10 MiB
9+
log.file.rotation.size = 10485760
10+
# keep up to 5 archived log files in addition to the current one
11+
log.file.rotation.count = 5

.docker/redis/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Redis
2+
3+
## Configure overcommit on host
4+
5+
For Linux kernel set [overcommit memory](https://redis.io/docs/manual/admin/#linux) setting to 1.
6+
7+
As sudo/root user:
8+
```shell
9+
echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf
10+
```
11+
12+
Activate setting
13+
14+
```shell
15+
sysctl vm.overcommit_memory=1
16+
```

.docker/redis/redis.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
appendonly yes
2+
maxmemory 5000mb
3+
maxmemory-policy allkeys-lru

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
1515

1616
###> IMAGE VERSIONS ###
17-
NGINX_IMAGE_VERSION="1.25-alpine"
18-
MYSQL_IMAGE_VERSION="8.2"
17+
NGINX_IMAGE_VERSION="1.27-alpine"
18+
MYSQL_IMAGE_VERSION="8.4"
1919
NODE_IMAGE_VERSION="20"
2020
###< IMAGE VERSIONS ###
2121

0 commit comments

Comments
 (0)