mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 03:31:09 -04:00
fix docker configuration
This commit is contained in:
83
Dockerfile
83
Dockerfile
@ -1,49 +1,40 @@
|
|||||||
FROM php:7.4-fpm-alpine
|
FROM php:7.4-fpm
|
||||||
|
|
||||||
|
# Arguments defined in docker-compose.yml
|
||||||
|
ARG user
|
||||||
|
ARG uid
|
||||||
|
|
||||||
|
# Install system dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
git \
|
||||||
|
curl \
|
||||||
|
libpng-dev \
|
||||||
|
libonig-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
zip \
|
||||||
|
unzip \
|
||||||
|
libzip-dev \
|
||||||
|
libmagickwand-dev \
|
||||||
|
mariadb-client
|
||||||
|
|
||||||
|
# Clear cache
|
||||||
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN pecl install imagick \
|
||||||
|
&& docker-php-ext-enable imagick
|
||||||
|
|
||||||
|
# Install PHP extensions
|
||||||
|
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl bcmath gd
|
||||||
|
|
||||||
|
# Get latest Composer
|
||||||
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
# Create system user to run Composer and Artisan Commands
|
||||||
|
RUN useradd -G www-data,root -u $uid -d /home/$user $user
|
||||||
|
RUN mkdir -p /home/$user/.composer && \
|
||||||
|
chown -R $user:$user /home/$user
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
USER $user
|
||||||
$PHPIZE_DEPS \
|
|
||||||
freetype-dev \
|
|
||||||
git \
|
|
||||||
zip \
|
|
||||||
libzip-dev \
|
|
||||||
php7-bcmath \
|
|
||||||
curl \
|
|
||||||
unzip \
|
|
||||||
libjpeg-turbo-dev \
|
|
||||||
libpng-dev \
|
|
||||||
libxml2-dev \
|
|
||||||
mariadb-client \
|
|
||||||
sqlite \
|
|
||||||
php7-json \
|
|
||||||
php7-openssl \
|
|
||||||
php7-pdo \
|
|
||||||
php7-pdo_mysql \
|
|
||||||
php7-session \
|
|
||||||
php7-simplexml \
|
|
||||||
php7-tokenizer \
|
|
||||||
php7-xml \
|
|
||||||
imagemagick \
|
|
||||||
imagemagick-libs \
|
|
||||||
imagemagick-dev \
|
|
||||||
php7-imagick \
|
|
||||||
php7-pcntl \
|
|
||||||
--repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ gnu-libiconv=1.15-r3
|
|
||||||
|
|
||||||
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
|
|
||||||
|
|
||||||
RUN printf "\n" | pecl install \
|
|
||||||
imagick && \
|
|
||||||
docker-php-ext-enable --ini-name 20-imagick.ini imagick
|
|
||||||
|
|
||||||
RUN docker-php-ext-configure zip
|
|
||||||
RUN docker-php-ext-install zip
|
|
||||||
RUN docker-php-ext-install iconv pdo pdo_mysql bcmath pcntl exif
|
|
||||||
RUN docker-php-ext-configure gd --with-jpeg --with-freetype
|
|
||||||
RUN docker-php-ext-install gd
|
|
||||||
|
|
||||||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
|
||||||
&& php composer-setup.php \
|
|
||||||
&& php -r "unlink('composer-setup.php');" \
|
|
||||||
&& mv composer.phar /usr/bin/composer
|
|
||||||
|
|||||||
@ -27,17 +27,19 @@ class Kernel extends ConsoleKernel
|
|||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
$schedule->command('check:invoices:status')
|
if (\Storage::disk('local')->has('database_created')) {
|
||||||
|
$schedule->command('check:invoices:status')
|
||||||
->daily();
|
->daily();
|
||||||
|
|
||||||
$schedule->command('check:estimates:status')
|
$schedule->command('check:estimates:status')
|
||||||
->daily();
|
->daily();
|
||||||
|
|
||||||
$recurringInvoices = RecurringInvoice::where('status', 'ACTIVE')->get();
|
$recurringInvoices = RecurringInvoice::where('status', 'ACTIVE')->get();
|
||||||
foreach ($recurringInvoices as $recurringInvoice) {
|
foreach ($recurringInvoices as $recurringInvoice) {
|
||||||
$schedule->call(function () use ($recurringInvoice) {
|
$schedule->call(function () use ($recurringInvoice) {
|
||||||
$recurringInvoice->generateInvoice();
|
$recurringInvoice->generateInvoice();
|
||||||
})->cron($recurringInvoice->frequency);
|
})->cron($recurringInvoice->frequency);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
version: '3.7'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
@ -39,7 +39,7 @@ services:
|
|||||||
image: nginx:1.17-alpine
|
image: nginx:1.17-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 80:80
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/var/www
|
- ./:/var/www
|
||||||
- ./docker-compose/nginx:/etc/nginx/conf.d/
|
- ./docker-compose/nginx:/etc/nginx/conf.d/
|
||||||
|
|||||||
Reference in New Issue
Block a user