-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (52 loc) · 1.54 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM php:7.3-fpm-alpine
LABEL maintainer="Brightfish <operations@brightfish.be>"
ARG APP_ENV
ARG APP_TIMEZONE
ENV COMPOSER_NO_INTERACTION=1
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_HTACCESS_PROTECT=0
RUN set -xe \
&& NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
\
# Set the container time and date
&& apk add --no-cache tzdata \
&& ln -sf /usr/share/zoneinfo/$APP_TIMEZONE /etc/localtime \
&& echo $APP_TIMEZONE > /etc/timezone \
\
# Compile-time packages
&& apk add --no-cache --virtual .ext-deps \
libpng-dev \
freetype-dev \
libjpeg-turbo-dev \
\
# Run-time packages
&& apk add --no-cache \
libzip-dev \
libpng \
freetype \
libjpeg-turbo \
\
# Compile modules using available cores
&& docker-php-ext-configure zip --with-libzip \
&& docker-php-ext-install -j${NPROC} pdo_mysql gd opcache zip \
&& rm -rf /tmp/* /var/cache/apk/* \
&& apk del -f .ext-deps
# PHP configuration
COPY ./install/php-${APP_ENV:-production}.ini /usr/local/etc/php/php.ini
# Install composer
COPY ./install/composer.sh /
RUN chmod +x /composer.sh \
&& sleep 1; /composer.sh \
&& rm /composer.sh
# Create the app root dir
WORKDIR /var/www/app
# Install Composer dependencies
COPY ./composer.* ./
RUN composer install -n --no-dev --no-scripts --no-autoloader --no-suggest
# Copy the app
COPY . .
# Ensure access to the storage and cache folders;
# make run command executable.
RUN chown -R www-data:www-data storage bootstrap \
&& chmod +x ./install/run.sh
CMD ./install/run.sh