mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-22 17:33:12 +00:00
optimize docker build
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
|
||||
set -xe
|
||||
|
||||
if [ $INSTALL_ACCOUNT_EMAIL = ""]; then
|
||||
if [ -z "$INSTALL_ACCOUNT_EMAIL" ]; then
|
||||
echo "INSTALL_ACCOUNT_EMAIL var is not set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $INSTALL_ACCOUNT_PASSWORD = ""]; then
|
||||
if [ -z "$INSTALL_ACCOUNT_PASSWORD" ]; then
|
||||
echo "INSTALL_ACCOUNT_PASSWORD var is not set."
|
||||
exit 1
|
||||
fi
|
||||
@@ -39,7 +39,6 @@ fi
|
||||
/var/alchemy/Phraseanet/bin/setup system:config set main.cache.type redis
|
||||
|
||||
# RabbitMQ
|
||||
|
||||
bin/setup system:config set rabbitmq.server.host rabbitmq
|
||||
bin/setup system:config set rabbitmq.server.port 5672
|
||||
bin/setup system:config set rabbitmq.server.user $INSTALL_RABBITMQ_USER
|
29
docker/phraseanet/entrypoint.sh
Executable file
29
docker/phraseanet/entrypoint.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
envsubst < "docker/phraseanet/php.ini.sample" > /usr/local/etc/php/php.ini
|
||||
envsubst < "docker/phraseanet/php-fpm.conf.sample" > /usr/local/etc/php-fpm.conf
|
||||
|
||||
chown -R app:app \
|
||||
config \
|
||||
datas \
|
||||
tmp \
|
||||
logs \
|
||||
www/thumbnails
|
||||
|
||||
FILE=config/configuration.yml
|
||||
|
||||
if [ -f "$FILE" ]; then
|
||||
echo "$FILE exists, skip setup."
|
||||
else
|
||||
echo "$FILE doesn't exist, entering setup..."
|
||||
runuser app -c docker/phraseanet/auto-install.sh
|
||||
fi
|
||||
|
||||
if [ ${XDEBUG_ENABLED} == "1" ]; then
|
||||
echo "XDEBUG is enabled. YOU MAY KEEP THIS FEATURE DISABLED IN PRODUCTION."
|
||||
docker-php-ext-enable xdebug
|
||||
fi
|
||||
|
||||
bash -e docker-php-entrypoint $@
|
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
envsubst < /php.ini.sample > /usr/local/etc/php/php.ini
|
||||
envsubst < /php-fpm.conf.sample > /usr/local/etc/php-fpm.conf
|
||||
|
||||
chown -R app:app /var/alchemy/Phraseanet/config
|
||||
chown -R app:app /var/alchemy/Phraseanet/datas
|
||||
chown -R app:app /var/alchemy/Phraseanet/tmp
|
||||
chown -R app:app /var/alchemy/Phraseanet/www/thumbnails
|
||||
FILE=/var/alchemy/Phraseanet/config/configuration.yml
|
||||
if [ -f "$FILE" ]; then
|
||||
echo "$FILE exists, skip setup."
|
||||
else
|
||||
echo "$FILE doesn't exist, entering setup..."
|
||||
runuser app -c '/phraseanet/auto-install.sh'
|
||||
fi
|
||||
|
||||
if [ ${XDEBUG_ENABLED} == "1" ]; then
|
||||
echo "XDEBUG is enabled. YOU MAY KEEP THIS FEATURE DISABLED IN PRODUCTION."
|
||||
docker-php-ext-enable xdebug
|
||||
fi
|
||||
|
||||
bash -e docker-php-entrypoint $@
|
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p /var/alchemy/Phraseanet/tmp/locks \
|
||||
&& chown -R app:app /var/alchemy/Phraseanet/tmp
|
||||
|
||||
envsubst < /php.ini.sample > /usr/local/etc/php/php.ini
|
||||
envsubst < /php-fpm.conf.sample > /usr/local/etc/php-fpm.conf
|
||||
|
||||
if [ ${XDEBUG_ENABLED} == "1" ]; then
|
||||
echo "XDEBUG is enabled. YOU MAY KEEP THIS FEATURE DISABLED IN PRODUCTION."
|
||||
docker-php-ext-enable xdebug
|
||||
fi
|
||||
|
||||
bash -e docker-php-entrypoint $@
|
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
runuser app -c 'php /var/alchemy/Phraseanet/bin/console task-manager:scheduler:run'
|
18
docker/phraseanet/worker/entrypoint.sh
Executable file
18
docker/phraseanet/worker/entrypoint.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
DOCKER_DIR="./docker/phraseanet"
|
||||
|
||||
mkdir -p "${APP_DIR}/tmp/locks" \
|
||||
&& chown -R app:app "${APP_DIR}/tmp"
|
||||
|
||||
envsubst < "${DOCKER_DIR}/php.ini.sample" > /usr/local/etc/php/php.ini
|
||||
envsubst < "${DOCKER_DIR}/php-fpm.conf.sample" > /usr/local/etc/php-fpm.conf
|
||||
|
||||
if [ ${XDEBUG_ENABLED} == "1" ]; then
|
||||
echo "XDEBUG is enabled. YOU MAY KEEP THIS FEATURE DISABLED IN PRODUCTION."
|
||||
docker-php-ext-enable xdebug
|
||||
fi
|
||||
|
||||
bash -e docker-php-entrypoint $@
|
3
docker/phraseanet/worker/scheduler-run.sh
Executable file
3
docker/phraseanet/worker/scheduler-run.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
runuser app -c 'php bin/console task-manager:scheduler:run'
|
Reference in New Issue
Block a user