-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (35 loc) · 1.47 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
FROM php:7.2-fpm
WORKDIR /app
# Versions
ENV COMPOSER_VERSION 1.1.2
RUN apt-get update && \
apt-get install -y apt-transport-https autoconf ca-certificates curl g++ gcc git \
libfontconfig1 libjpeg62-turbo-dev libpng-dev libxml2-dev libxrender1 make \
zip zlib1g-dev nodejs yarn && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin \
--filename=composer --version=${COMPOSER_VERSION} && \
chmod +x /usr/local/bin/composer && \
rm -rf /var/lib/apt/lists/*
RUN pecl install apcu && \
echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini && \
docker-php-ext-install bcmath && \
docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ && \
docker-php-ext-install -j$(nproc) gd zip pdo pdo_mysql soap sockets pcntl opcache shmop && \
echo "opcache.enable_cli=1" > /usr/local/etc/php/conf.d/opcache-cli.ini && \
chown www-data.www-data -R $(php-config --prefix)/etc/php/conf.d
ADD ./composer.json ./composer.lock /app/
RUN composer global require hirak/prestissimo && \
/usr/local/bin/composer install --no-autoloader --no-scripts
COPY --chown=www-data:www-data . /app
RUN /usr/local/bin/composer install
RUN mkdir -p \
bootstrap/cache \
storage/app \
storage/framework/cache \
storage/framework/sessions \
storage/framework/views \
storage/logs && \
mv envs/.env.production .env
USER www-data
ENTRYPOINT ["bin/entrypoint.sh"]
CMD ["web"]