mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 04:31:08 -04:00
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:
@ -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"]
|
||||
@ -1 +0,0 @@
|
||||
* * * * * cd /var/www && php artisan schedule:run >> /dev/stdout 2>&1
|
||||
@ -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
16
docker-compose/startup.sh
Executable 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
|
||||
Reference in New Issue
Block a user