-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHRAS-4010 Add mysql8 as alternative datastore (#4477)
* PHRAS-4010 : add profile and alternative compose file * PHRAS-4010 : add entrypoint * PHRAS-4010 : update .env * fix compatibility base_structures.xml -> mysql8 for sys:up * fix timestamp DEFAULT_GENERATED * fix mysql 8 version * Update .env
- Loading branch information
1 parent
3bf99cb
commit 0feb7e9
Showing
3 changed files
with
98 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: "3.9" | ||
|
||
services: | ||
|
||
db: | ||
image: mysql:8.0.36-debian | ||
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password | ||
# (this is just an example, not intended to be a production configuration) | ||
command: --default-authentication-plugin=mysql_native_password --max_allowed_packet=$MYSQL_MAX_ALLOWED_PACKET --max_connections=$MYSQL_MAX_CONNECTION --long_query_time=$MYSQL_LONG_QUERY_TIME --sql_mode="NO_ENGINE_SUBSTITUTION" | ||
restart: on-failure | ||
profiles: ["mysql8"] | ||
entrypoint: | ||
sh -c " | ||
echo 'CREATE DATABASE IF NOT EXISTS ab_master CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE DATABASE IF NOT EXISTS db_databox1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE DATABASE IF NOT EXISTS db_unitTest CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE DATABASE IF NOT EXISTS db_dataset1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE DATABASE IF NOT EXISTS db_dataset2 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER `$PHRASEANET_DB_USER`@`%` IDENTIFIED BY \"$PHRASEANET_DB_PASSWORD\";GRANT ALL PRIVILEGES ON *.* to `$PHRASEANET_DB_USER`@`%`;' > /docker-entrypoint-initdb.d/init.sql; | ||
chmod +x /usr/local/bin/docker-entrypoint.sh /docker-entrypoint-initdb.d/init.sql; | ||
/usr/local/bin/docker-entrypoint.sh --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-authentication-plugin=mysql_native_password --max_allowed_packet=$MYSQL_MAX_ALLOWED_PACKET --max_connections=$MYSQL_MAX_CONNECTION --long_query_time=$MYSQL_LONG_QUERY_TIME --sql_mode="NO_ENGINE_SUBSTITUTION" --slow_query_log=$MYSQL_SLOW_QUERY_LOG | ||
" | ||
environment: | ||
- MYSQL_ROOT_PASSWORD | ||
- MYSQL_MAX_ALLOWED_PACKET | ||
- MYSQL_MAX_CONNECTION | ||
- MYSQL_LONG_QUERY_TIME | ||
- MYSQL_SLOW_QUERY_LOG | ||
- MYSQL_QUERY_CACHE_LIMIT | ||
- MYSQL_QUERY_CACHE_SIZE | ||
- MYSQL_KEY_BUFFER_SIZE | ||
volumes: | ||
- ${PHRASEANET_DB_DIR}_mysql8:/var/lib/mysql:rw | ||
networks: | ||
- internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters