simplified deployment with docker (#639)

* updated Dockerfile and docker-compose.yml, replaced cron with ofelia and setup.sh with automatically executed startup.sh

* fixed permissions by setting them in setup-script
This commit is contained in:
LU-386
2022-03-16 13:59:21 +01:00
committed by GitHub
parent 18507ddb6f
commit e03320d27b
6 changed files with 46 additions and 54 deletions

View File

@ -1,10 +0,0 @@
FROM php:7.4-fpm-alpine
RUN apk add --no-cache \
php7-bcmath
RUN docker-php-ext-install pdo pdo_mysql bcmath
COPY docker-compose/crontab /etc/crontabs/root
CMD ["crond", "-f"]

View File

@ -1 +0,0 @@
* * * * * cd /var/www && php artisan schedule:run >> /dev/stdout 2>&1

View File

@ -1,6 +0,0 @@
#!/bin/sh
docker-compose exec app composer install --no-interaction --prefer-dist --optimize-autoloader
docker-compose exec app php artisan storage:link || true
docker-compose exec app php artisan key:generate

16
docker-compose/startup.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
chmod 775 /var/www/ -R
chown 1000:33 /var/www -R
if [ ! -f ".env" ]; then
cp .env.example .env
echo "created .env from .env.example"
fi
composer install --no-interaction --prefer-dist --optimize-autoloader
php artisan storage:link || true
php artisan key:generate
php-fpm