feat: init

This commit is contained in:
montaghanmy
2023-03-23 11:03:16 +01:00
commit 10fe6f78d1
11518 changed files with 509786 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM twaketech/php7.1-cassandra
LABEL org.opencontainers.image.authors="Romaric Mourgues <romaric.mourgues@twakeapp.com>,Nguyen Thai <tknguyen@linagora.com>"
#Crontab
ADD docker/twake-php/crontab /etc/cron.d/twake-cron
COPY backend/core/ /twake-core/
COPY docker/twake-php/entrypoint.sh /
RUN chmod 0644 /etc/cron.d/twake-cron && \
touch /var/log/cron.log && \
cd /twake-core/ && php composer.phar install && \
chmod +x /entrypoint.sh
#For exec
WORKDIR /twake-core/
ENTRYPOINT ["/entrypoint.sh", "$DEV"]
+30
View File
@@ -0,0 +1,30 @@
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
* * * * * root cd /twake-core/; php bin/console twake:mails_queue;
* * * * * root cd /twake-core/; php bin/console twake:node:push_mobile;
* * * * * root cd /twake-core/; php bin/console twake:node:push_channel_activity;
* * * * * root cd /twake-core/; php bin/console twake:calendar_check;
* * * * * root cd /twake-core/; php bin/console twake:tasks_check_reminders;
* * * * * root cd /twake-core/; php bin/console twake:notifications_mail;
* * * * * root cd /twake-core/; php bin/console twake:preview_worker;
* * * * * root cd /twake-core/; php bin/console twake:scheduled_notifications_consume_timetable
* * * * * root cd /twake-core/; php bin/console twake:scheduled_notifications_consume_shard
* * * * * root chmod -R 777 /twake-core/cache;
32 * * * * root kill -USR2 1;
#
#
+48
View File
@@ -0,0 +1,48 @@
#!/bin/sh
if [ -z "$TIMEZONE" ]; then
TIMEZONE=Etc/UTC
fi
echo $TIMEZONE > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata
sed -i "s|;date.timezone =.*|date.timezone = $TIMEZONE|" /etc/php5/*/php.ini
if [ -n "$PHP_MEMORY_LIMIT" ]; then
sed -i "s/^memory_limit =.*/memory_limit = $PHP_MEMORY_LIMIT/" /etc/php5/*/php.ini
fi
chmod -R 777 /var/www &
chmod -R 777 /tmp/
rm -R /tmp/*
chmod -R 777 /twake-core/ &
mkdir /twake-core/cache
chmod -R 777 /twake-core/cache &
if [ "$1" = "dev" ]
then
if test -f "/twake-core/app/Configuration/Parameters.php"; then
echo "Configuration exists, doing nothing."
else
cp /twake-core/app/Configuration/Parameters.php.dist /twake-core/app/Configuration/Parameters.php
fi
php composer.phar install
else
if test -f "/configuration/Parameters.php"; then
cp /configuration/Parameters.php /twake-core/app/Configuration/Parameters.php
else
cp /twake-core/app/Configuration/Parameters.php.dist /twake-core/app/Configuration/Parameters.php
fi
fi
(php composer.phar dump-autoload --optimize; php composer.phar dump-autoload --classmap-authoritative; php composer.phar dump-autoload --apcu; php bin/console twake:schema:update; php bin/console twake:init; php bin/console twake:init_connector; php bin/console twake:mapping) &
mkdir /twake-core/cache
chmod -R 777 /twake-core/cache &
echo "" >> /etc/cron.d/twake-cron
cron -f &
docker-php-entrypoint php-fpm