1
1
FROM php:7.3-fpm
2
2
3
- # Environment Variables
4
3
ENV MASTER_TZ=Asia/Manila
5
4
ENV MASTER_DIR=/var/www/html
6
5
7
6
RUN ln -snf /usr/share/zoneinfo/${MASTER_TZ} /etc/localtime && echo ${MASTER_TZ} > /etc/timezone
8
7
9
- # Install dependencies
10
8
RUN apt-get update && apt-get install -y \
11
9
build-essential \
12
10
libzip-dev \
@@ -21,15 +19,15 @@ RUN apt-get update && apt-get install -y \
21
19
git \
22
20
curl
23
21
24
- # Clear cache
25
22
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
26
23
27
- # Install PHP extensions
28
24
RUN docker-php-ext-install bcmath pdo_mysql mbstring zip exif pcntl && \
29
25
docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ && \
30
26
docker-php-ext-install gd
31
27
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
+
33
31
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
34
32
35
33
# This will allow the container to use a cached version of PHP packages
@@ -38,19 +36,13 @@ COPY composer.lock composer.json ${MASTER_DIR}/
38
36
# This is included just to bypass errors thrown by composer scripts
39
37
COPY database ${MASTER_DIR}/database
40
38
41
- WORKDIR ${MASTER_DIR}
42
-
43
- # Install app dependencies
44
39
RUN composer install --no-interaction --no-plugins --no-scripts
45
40
46
- # Copy app
47
41
COPY . ${MASTER_DIR}
48
-
49
- # Copy scripts
50
42
COPY ./.docker/scripts/queuer.sh /usr/local/bin/laravel-queuer
51
43
COPY ./.docker/scripts/scheduler.sh /usr/local/bin/laravel-scheduler
52
44
53
- # Give the scripts executable permissions
45
+ RUN chmod -R 775 /var/www/html/storage
54
46
RUN chmod u+x /usr/local/bin/laravel-queuer
55
47
RUN chmod u+x /usr/local/bin/laravel-scheduler
56
48
0 commit comments