mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-07 01:54:27 +00:00
PHRAS-3980 cmd container (#4440)
PHRAS-3980 cmd container for docker compose ready
This commit is contained in:
13
.env
13
.env
@@ -44,8 +44,9 @@
|
||||
# - "gateway-traefik" : nginx is launched behind a traefik service, the traefik is include in this stack (todo)
|
||||
# or Traefik include in Phrasea Stack.
|
||||
# - "workers" : launch one worker container by kind of Jobs, you can also
|
||||
# choose to launch only some workers, see worker list below.
|
||||
# choose to launch only some workers, see worker profile list below.
|
||||
# - "worker" : launch one container worker with all jobs run on it.
|
||||
# - "cmd" : launch a container based on worker image, useful for run cmd manualy.
|
||||
# - "db" : launch a mariadb container, because this is the primary
|
||||
# datastore for production usage, use your own service.
|
||||
# - "elastisearch" : launch a elasticsearch container.
|
||||
@@ -89,11 +90,11 @@
|
||||
#
|
||||
# For development:
|
||||
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml:docker-compose.override.yml
|
||||
# - COMPOSE_PROFILES=app,setup,db,pma,elasticsearch,redis,redis-session,rabbitmq,workers,mailhog,builder,gateway-classic
|
||||
# - COMPOSE_PROFILES=app,setup,db,pma,elasticsearch,redis,redis-session,rabbitmq,workers,mailhog,builder,gateway-classic,cmd
|
||||
#
|
||||
# For testing with tools:
|
||||
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml
|
||||
# - COMPOSE_PROFILES=app,setup,db,pma,elasticsearch,rabbitmq,redis,redis-session,worker,workers,mailhog,gateway-classic
|
||||
# - COMPOSE_PROFILES=app,setup,db,pma,elasticsearch,rabbitmq,redis,redis-session,workers,cmd,mailhog,gateway-classic
|
||||
#
|
||||
# For testing with debug and SSL (the traekik is provide by Phrasea stack):
|
||||
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml:docker-compose.under-phrasea.yml
|
||||
@@ -107,7 +108,7 @@
|
||||
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml
|
||||
# - COMPOSE_PROFILES=app,setup,gateway-classic,db,elasticsearch,redis,redis-session,rabbitmq,pma,mailhog,assetsInjest,createRecord,deleteRecord,editRecord,
|
||||
# exportMail,downloadAsync,exposeUpload,exportFtp,mainQueue,populateIndex,pullAssets,recordsActions,subdefCreation,
|
||||
# validationReminder,webhook,writeMetadatas,shareBasket,scheduler,elk,db-backup,phraseanet-saml-sp
|
||||
# validationReminder,webhook,writeMetadatas,shareBasket,scheduler,cmd,elk,db-backup,phraseanet-saml-sp
|
||||
#
|
||||
|
||||
|
||||
@@ -772,7 +773,9 @@ PHRASEANET_WORKER_writeMetadatas=1
|
||||
# @run
|
||||
PHRASEANET_WORKER_shareBasket=1
|
||||
|
||||
|
||||
# PHRASEANET_CMD_MODE=1, set a worker container for run bin/console... or bin/maintenance... manualy
|
||||
# @run
|
||||
PHRASEANET_CMD_MODE
|
||||
|
||||
# --- Phraseanet Locales settings --------------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -195,6 +195,13 @@ services:
|
||||
networks:
|
||||
- internal
|
||||
|
||||
cmd:
|
||||
volumes:
|
||||
- ../:/var/alchemy
|
||||
- .:/var/alchemy/Phraseanet
|
||||
networks:
|
||||
- internal
|
||||
|
||||
rabbitmq:
|
||||
ports:
|
||||
- ${RABBITMQ_MANAGEMENT_PORT}:15672
|
||||
|
@@ -302,7 +302,6 @@ services:
|
||||
- LC_NAME=C.UTF-8
|
||||
- PHRASEANET_EXPLODE_WORKER
|
||||
- PHRASEANET_WORKERS_LAUNCH_METHOD
|
||||
- PHRASEANET_WORKER_CUSTOM
|
||||
- PHRASEANET_WORKER_assetsIngest
|
||||
- PHRASEANET_WORKER_createRecord
|
||||
- PHRASEANET_WORKER_deleteRecord
|
||||
@@ -1315,6 +1314,49 @@ services:
|
||||
networks:
|
||||
- internal
|
||||
|
||||
cmd:
|
||||
build:
|
||||
context: .
|
||||
target: phraseanet-worker
|
||||
args:
|
||||
- SSH_PRIVATE_KEY=${PHRASEANET_SSH_PRIVATE_KEY}
|
||||
- PHRASEANET_PLUGINS=${PHRASEANET_PLUGINS}
|
||||
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-worker:$PHRASEANET_DOCKER_TAG
|
||||
profiles: ["cmd"]
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- phraseanet
|
||||
environment:
|
||||
- STACK_NAME
|
||||
- OPCACHE_ENABLED
|
||||
- SESSION_CACHE_LIMITER
|
||||
- PHP_LOG_LEVEL
|
||||
- PHP_CLI_MEMORY_LIMIT
|
||||
- LC_MESSAGES=C.UTF-8
|
||||
- LC_COLLATE=C.UTF-8
|
||||
- LC_IDENTIFICATION=C.UTF-8
|
||||
- LANG=C.UTF-8
|
||||
- LC_MEASUREMENT=C.UTF-8
|
||||
- LC_CTYPE=C.UTF-8
|
||||
- LC_TIME=C.UTF-8
|
||||
- LC_NAME=C.UTF-8
|
||||
- PHRASEANET_CMD_MODE
|
||||
- PHRASEANET_EXPLODE_WORKER
|
||||
- PHRASEANET_WORKERS_LAUNCH_METHOD
|
||||
- NEWRELIC_ENABLED
|
||||
- NEWRELIC_LICENSE_KEY
|
||||
- NEWRELIC_APP_NAME
|
||||
volumes:
|
||||
- ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw
|
||||
- ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw
|
||||
- ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
|
||||
- ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
|
||||
- ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
|
||||
- ${PHRASEANET_CACHE_DIR}:/var/alchemy/Phraseanet/cache:rw
|
||||
- ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
|
||||
networks:
|
||||
- internal
|
||||
|
||||
|
||||
volumes:
|
||||
config_vol:
|
||||
|
@@ -30,17 +30,6 @@ else
|
||||
rm -f /usr/local/etc/php/conf.d/newrelic.ini
|
||||
fi
|
||||
|
||||
if [[ $BLACKFIRE_ENABLED = "true" ]]; then
|
||||
echo `date +"%Y-%m-%d %H:%M:%S"` " - BlackFire setup."
|
||||
blackfire-agent --register --server-id=$BLACKFIRE_SERVER_ID --server-token=$BLACKFIRE_SERVER_TOKEN
|
||||
service blackfire-agent start
|
||||
echo "Blackfire setup done"
|
||||
else
|
||||
echo `date +"%Y-%m-%d %H:%M:%S"` " - blackfire extension deactivation."
|
||||
rm -f /usr/local/etc/php/conf.d/zz-blackfire.ini
|
||||
fi
|
||||
|
||||
|
||||
./docker/phraseanet/plugins/console init
|
||||
|
||||
chown -R app:app cache
|
||||
|
@@ -113,6 +113,11 @@ else
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -z "$PHRASEANET_CMD_MODE" ] && [ ${PHRASEANET_CMD_MODE} == "1" ] ; then
|
||||
apt update
|
||||
apt install screen
|
||||
echo "Worker are in custom process mode"
|
||||
fi
|
||||
|
||||
echo $NBR_WORKERS " workers defined"
|
||||
echo $NBR_WORKERS > bin/workers_count.txt
|
||||
|
Reference in New Issue
Block a user