11FROM php:7.3-fpm
22
3- # Environment Variables
43ENV MASTER_TZ=Asia/Manila
54ENV MASTER_DIR=/var/www/html
65
76RUN ln -snf /usr/share/zoneinfo/${MASTER_TZ} /etc/localtime && echo ${MASTER_TZ} > /etc/timezone
87
9- # Install dependencies
108RUN apt-get update && apt-get install -y \
119 build-essential \
1210 libzip-dev \
@@ -21,15 +19,15 @@ RUN apt-get update && apt-get install -y \
2119 git \
2220 curl
2321
24- # Clear cache
2522RUN apt-get clean && rm -rf /var/lib/apt/lists/*
2623
27- # Install PHP extensions
2824RUN docker-php-ext-install bcmath pdo_mysql mbstring zip exif pcntl && \
2925 docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ && \
3026 docker-php-ext-install gd
3127
32- # Install composer
28+ # This will override default PHP configuration
29+ COPY .docker/php-fpm/php.ini /usr/local/etc/php/conf.d/local.ini:ro
30+
3331RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
3432
3533# This will allow the container to use a cached version of PHP packages
@@ -38,19 +36,13 @@ COPY composer.lock composer.json ${MASTER_DIR}/
3836# This is included just to bypass errors thrown by composer scripts
3937COPY database ${MASTER_DIR}/database
4038
41- WORKDIR ${MASTER_DIR}
42-
43- # Install app dependencies
4439RUN composer install --no-interaction --no-plugins --no-scripts
4540
46- # Copy app
4741COPY . ${MASTER_DIR}
48-
49- # Copy scripts
5042COPY ./.docker/scripts/queuer.sh /usr/local/bin/laravel-queuer
5143COPY ./.docker/scripts/scheduler.sh /usr/local/bin/laravel-scheduler
5244
53- # Give the scripts executable permissions
45+ RUN chmod -R 775 /var/www/html/storage
5446RUN chmod u+x /usr/local/bin/laravel-queuer
5547RUN chmod u+x /usr/local/bin/laravel-scheduler
5648
0 commit comments