diff --git a/.env b/.env index 114398558f..39ec089b92 100644 --- a/.env +++ b/.env @@ -42,7 +42,7 @@ # # - "docker-compose.limits.yml" : defines containers cpu and memory limits for all Phraseanet and gateway containers only. # -# - "docker-compose.altenatives.yml": all alternative services, used only on evoluation or transition periods +# - "docker-compose.alternatives.yml": all alternative services, used only on evolution or transition or testing periods # # 2/ "COMPOSE_PROFILES" value define which profiles you want to use # in docker-compose. @@ -72,7 +72,7 @@ # - "mailhog" : for catching all email emit by app for dev and testing. # - "db-backup" : launch and run a container to cron database backups and backup file's rotation. # - "pma" : launch a phpmyadmin container for test and dev purpose. -# - "mysql8" : launch a mysql8 container (beta), (/!\ do not mix with the "db" profile) +# - "db-mysql8" : launch a mysql8 container (beta), (/!\ do not mix with the "db" profile) # Because this is the primary datastore, you should use you own SGDD service for production needs. # # Profiles worker list: @@ -279,7 +279,7 @@ RABBITMQ_MANAGEMENT_PORT=10811 RABBITMQ_HOSTNAME=rabbit_phraseanet # @run -RABBITMQ_IMAGE_VERSION=rabbitmq:4.1.0-management +RABBITMQ_IMAGE_TAG=rabbitmq:4.1.0-management # --- Gateway settings (Nginx) ----------------------------------------------------------------------------------------- @@ -580,6 +580,17 @@ DB_BACKUP_CRON_TIME= # @run DB_BACKUP_GZIP_LEVEL=9 +# --- redis cache settings --------------------------------------------------------------------------------------------- + +# Redis session Image Tag. +# @run +REDIS_CACHE_IMAGE_TAG=redis:8.0.1 + +# --- redis session settings --------------------------------------------------------------------------------------------- + +# Redis cache Image Tag. +# @run +REDIS_SESSION_IMAGE_TAG=redis:8.0.1 # --- Pusher Settings --- # Phraseanet use the Pusher service to notify users of asynchronous downloads https://pusher.com. diff --git a/docker-compose.altenatives.yml b/docker-compose.alternatives.yml similarity index 75% rename from docker-compose.altenatives.yml rename to docker-compose.alternatives.yml index 176a82a99c..5d511fa7f0 100644 --- a/docker-compose.altenatives.yml +++ b/docker-compose.alternatives.yml @@ -1,18 +1,39 @@ services: db: + image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-db:$PHRASEANET_DOCKER_TAG + build: ./docker/db + restart: on-failure + profiles: ["db-volume-container"] + 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 + - MYSQL_CONNECT_TIMEOUT + - MYSQL_WAIT_TIMEOUT + - MARIADB_AUTO_UPGRADE + volumes: + - db_vol:/var/lib/mysql + networks: + - internal + db-mysql8: 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"] + profiles: ["db-mysql8"] entrypoint: - sh -c " + 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 @@ -27,4 +48,7 @@ services: volumes: - ${PHRASEANET_DB_DIR}_mysql8:/var/lib/mysql:rw networks: - - internal + internal: + aliases: + - db + diff --git a/docker-compose.datastores.yml b/docker-compose.datastores.yml index a30bf5eecf..56c6e899dc 100644 --- a/docker-compose.datastores.yml +++ b/docker-compose.datastores.yml @@ -22,7 +22,7 @@ services: - internal rabbitmq: - image: $RABBITMQ_IMAGE_VERSION + image: $RABBITMQ_IMAGE_TAG profiles: ["rabbitmq"] restart: on-failure hostname: $RABBITMQ_HOSTNAME @@ -35,14 +35,14 @@ services: - internal redis: - image: redis + image: $REDIS_CACHE_IMAGE_TAG profiles: ["redis"] restart: on-failure networks: - internal redis-session: - image: redis + image: $REDIS_SESSION_IMAGE_TAG profiles: ["redis-session"] restart: on-failure networks: diff --git a/docker-compose.tools.yml b/docker-compose.tools.yml index c1c44a6e88..fec1a794be 100644 --- a/docker-compose.tools.yml +++ b/docker-compose.tools.yml @@ -28,8 +28,6 @@ services: restart: on-failure ports: - ${PHRASEANET_PHPMYADMIN_PORT}:80 - depends_on: - - db networks: - internal