Redis image tag from env and others docker stacks fixs

This commit is contained in:
nmaillat
2025-05-20 18:35:06 +02:00
parent 5dd527d339
commit d37b627042
3 changed files with 40 additions and 7 deletions

15
.env
View File

@@ -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.
@@ -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.

View File

@@ -1,6 +1,27 @@
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)
@@ -8,11 +29,11 @@ services:
restart: on-failure
profiles: ["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
@@ -28,3 +49,4 @@ services:
- ${PHRASEANET_DB_DIR}_mysql8:/var/lib/mysql:rw
networks:
- internal

View File

@@ -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: