Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RMQ3.10 + Mysql 8 #482

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/service/database/mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function Database::init() {
mysql \
-h "${SPRYKER_DB_HOST}" \
-u root \
-e "CREATE DATABASE IF NOT EXISTS \`${SPRYKER_DB_DATABASE}\` CHARACTER SET \"${SPRYKER_DB_CHARACTER_SET}\" COLLATE \"${SPRYKER_DB_COLLATE}\"; GRANT ALL PRIVILEGES ON \`${SPRYKER_DB_DATABASE}\`.* TO \"${SPRYKER_DB_USERNAME}\"@\"%\" IDENTIFIED BY \"${SPRYKER_DB_PASSWORD}\" WITH GRANT OPTION;"
-e "CREATE DATABASE IF NOT EXISTS \`${SPRYKER_DB_DATABASE}\` CHARACTER SET \"${SPRYKER_DB_CHARACTER_SET}\" COLLATE \"${SPRYKER_DB_COLLATE}\"; CREATE USER IF NOT EXISTS '${SPRYKER_DB_USERNAME}'@'%' IDENTIFIED BY '${SPRYKER_DB_PASSWORD}'; GRANT ALL PRIVILEGES ON \`${SPRYKER_DB_DATABASE}\`.* TO '${SPRYKER_DB_USERNAME}'@'%'; FLUSH PRIVILEGES;"
else
echo ${databases} | jq -c '.[]' | while read line; do
SPRYKER_DB_HOST=$(echo $line | jq -r .host);
Expand All @@ -71,10 +71,10 @@ function Database::init() {
SPRYKER_DB_CHARACTER_SET=$(echo $line | jq -r .characterSet);
SPRYKER_DB_COLLATE=$(echo $line | jq -r .collate);
export MYSQL_PWD="${SPRYKER_DB_ROOT_PASSWORD}";
mysql \
mysql \
-h "${SPRYKER_DB_HOST}" \
-u root \
-e "CREATE DATABASE IF NOT EXISTS \`${SPRYKER_DB_DATABASE}\` CHARACTER SET \"${SPRYKER_DB_CHARACTER_SET}\" COLLATE \"${SPRYKER_DB_COLLATE}\"; GRANT ALL PRIVILEGES ON \`${SPRYKER_DB_DATABASE}\`.* TO \"${SPRYKER_DB_USERNAME}\"@\"%\" IDENTIFIED BY \"${SPRYKER_DB_PASSWORD}\" WITH GRANT OPTION;"
-e "CREATE DATABASE IF NOT EXISTS \`${SPRYKER_DB_DATABASE}\` CHARACTER SET \"${SPRYKER_DB_CHARACTER_SET}\" COLLATE \"${SPRYKER_DB_COLLATE}\";CREATE USER IF NOT EXISTS '${SPRYKER_DB_USERNAME}'@'%' IDENTIFIED BY '${SPRYKER_DB_PASSWORD}';GRANT ALL PRIVILEGES ON \`${SPRYKER_DB_DATABASE}\`.* TO '${SPRYKER_DB_USERNAME}'@'%';FLUSH PRIVILEGES;"
done
fi
EOF
Expand Down
File renamed without changes.
46 changes: 46 additions & 0 deletions context/mysql/8.0/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[mysqld]

# GENERAL #
user = mysql
default_storage_engine = InnoDB
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
bind-address = 0.0.0.0
port = 3306

default-authentication-plugin = mysql_native_password

# DATA STORAGE #
datadir = /var/lib/mysql
tmpdir = /tmp

# INNODB #
default_storage_engine = InnoDB
innodb_buffer_pool_size = 1G # Adjust based on your server's memory
innodb_log_file_size = 512M
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 1

# CACHES AND LIMITS #
tmp_table_size = 128M
max_heap_table_size = 128M
max_connections = 500
thread_cache_size = 50
open_files_limit = 65535
table_open_cache = 4096
table_definition_cache = 4096

# LOGGING #
log_error = /var/log/mysql/mysql-error.log
log_queries_not_using_indexes = 1
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log

[mysqldump]
max_allowed_packet = 64M

[isamchk]
key_buffer = 16M

!includedir /etc/mysql/conf.d/
6 changes: 3 additions & 3 deletions context/php/debug/etc/debug.php-fpm.d/worker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ group = www-data
pm = dynamic
pm.max_children = 4
pm.start_servers = 2
pm.min_spare_servers = 1
pm.min_spare_servers = 2
pm.max_spare_servers = 2
pm.max_requests = 500
pm.max_requests = 1

pm.status_path = /php-fpm-status-worker
ping.path = /fpm-ping.php
ping.response = OK

request_terminate_timeout = 60m
request_terminate_timeout = 5m

chdir = /

Expand Down
2 changes: 1 addition & 1 deletion generator/src/templates/service/mysql/5.7/mysql.yml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
LANG: C.UTF-8
volumes:
- {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/lib/mysql:rw
- ./${DEPLOYMENT_PATH}/context/mysql/my.cnf:/etc/mysql/my.cnf:ro
- ./${DEPLOYMENT_PATH}/context/mysql/5.7/my.cnf:/etc/mysql/my.cnf:ro
22 changes: 22 additions & 0 deletions generator/src/templates/service/mysql/8.0/mysql.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{ serviceName }}:
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password --sql_mode=''
networks:
- private
labels:
'spryker.app.name': database
'spryker.app.type': services
'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG}
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
environment:
MYSQL_ROOT_USERNAME: "{{ serviceData['root']['username'] }}"
MYSQL_ROOT_PASSWORD: "{{ serviceData['root']['password'] }}"
LANG: C.UTF-8
volumes:
- {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/lib/mysql:rw
- ./${DEPLOYMENT_PATH}/context/mysql/8.0/my.cnf:/etc/mysql/my.cnf:ro
19 changes: 19 additions & 0 deletions generator/src/templates/service/rabbitmq/3.10/rabbitmq.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{ serviceName }}:
image: spryker/rabbitmq:3.10
hostname: {{ serviceName }} # RabbitMQ determines the cluster by its hostname
networks:
- private
labels:
'spryker.app.name': broker
'spryker.app.type': services
'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG}
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "5672" ]
interval: 10s
timeout: 5s
retries: 10
environment:
RABBITMQ_DEFAULT_USER: "{{ serviceData['api']['username'] }}"
RABBITMQ_DEFAULT_PASS: "{{ serviceData['api']['password'] }}"
volumes:
- {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/lib/rabbitmq:rw
Loading