feat(docker): prod, fix misc

This commit is contained in:
Michael 2025-06-10 13:36:10 +02:00
parent bff6c0e339
commit b0a7ff757a
2 changed files with 14 additions and 11 deletions

View file

@ -322,9 +322,7 @@ RUN docker-php-ext-install gd exif pcntl bcmath mysqli pdo_mysql mbstring && \
# Create system user to run Composer and Artisan Commands
RUN set -eux && useradd -G www-data -u $sintonia_uid -d /home/$sintonia_user $sintonia_user && \
mkdir -p /home/$sintonia_user/.composer && \
mkdir -p /var/www/sintonia_webapp && \
chown -R $sintonia_user:$sintonia_user /home/$sintonia_user && \
chown -R $sintonia_user:$sintonia_user /var/www/sintonia_webapp
chown -R $sintonia_user:$sintonia_user /home/$sintonia_user
RUN echo "* * * * * cd /var/www/sintonia_webapp && /usr/local/bin/php artisan schedule:run >> /proc/1/fd/1 2>> /proc/1/fd/2" >> /etc/cron.d/laravel_jobs && \
chown $sintonia_user:$sintonia_user /etc/cron.d/laravel_jobs && \
@ -383,7 +381,9 @@ RUN touch /usr/local/var/log/fpm-php.access.log /usr/local/var/log/fpm-php.error
chown $sintonia_user:$sintonia_user /usr/local/var/log/fpm-php.access.log /usr/local/var/log/fpm-php.error.log && \
chmod 660 /usr/local/var/log/fpm-php.access.log /usr/local/var/log/fpm-php.error.log && \
sed -i 's/access.log = \/proc\/self\/fd\/2/access.log = \/usr\/local\/var\/log\/fpm-php.access.log/g' /usr/local/etc/php-fpm.d/docker.conf && \
sed -i 's/error_log = \/proc\/self\/fd\/2/error_log = \/usr\/local\/var\/log\/fpm-php.error.log/g' /usr/local/etc/php-fpm.d/docker.conf
sed -i 's/error_log = \/proc\/self\/fd\/2/error_log = \/usr\/local\/var\/log\/fpm-php.error.log/g' /usr/local/etc/php-fpm.d/docker.conf && \
mkdir -p /var/www/sintonia_webapp && \
chown -R $sintonia_user:$sintonia_user /var/www/sintonia_webapp
COPY ./dev/sintonia-webapp/php/php-ini-development /usr/local/etc/php/php.ini
@ -420,21 +420,23 @@ COPY ./docker/sintonia-webapp/laravel/.env.production.example /home/$sintonia_us
RUN chown $sintonia_user:$sintonia_user /home/$sintonia_user/.env
USER $sintonia_user
ENV sintonia_user=${sintonia_user}
WORKDIR /var/www/sintonia_webapp
CMD git clone --branch dev --single-branch https://git.congegni.net/Congegni/sintonia_webapp . && \
cp /home/$sintonia_user/.env /var/www/sintonia_webapp && \
RUN git clone --branch dev --single-branch https://git.congegni.net/Congegni/sintonia_webapp . && \
mv /home/$sintonia_user/.env /var/www/sintonia_webapp
CMD git pull && \
/home/$sintonia_user/composer install --no-progress --no-interaction && \
/home/$sintonia_user/composer --no-cache dump-autoload --no-interaction && \
rm -rf /var/www/sintonia_webapp/node_modules /var/www/sintonia_webapp/.npm /var/www/sintonia_webapp/.composer /var/www/sintonia_webapp/.git && \
rm -rf /home/$sintonia_user/node* /home/$sintonia_user/composer && \
npm i && \
npm run build && \
php artisan key:generate && \
php artisan migrate && \
php artisan db:seed && \
php artisan schedule:run >> /dev/null 2>&1 && \
set -eux && \
npm i && \
npm run build && \
rm -rf /var/www/sintonia_webapp/node_modules /var/www/sintonia_webapp/.npm /var/www/sintonia_webapp/.composer /var/www/sintonia_webapp/.git && \
rm -rf /home/$sintonia_user/node* /home/$sintonia_user/composer && \
cron && \
php-fpm -F

View file

@ -165,3 +165,4 @@ volumes:
libretime_assets: {}
libretime_playout: {}
sintonia_assets: {}