-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
82 lines (55 loc) · 2.1 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FROM php:7.4-fpm
USER root
WORKDIR /var/www
# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends procps build-essential openssl nginx libfreetype6-dev libjpeg-dev libpng-dev libwebp-dev zlib1g-dev libzip-dev gcc g++ make vim unzip curl git jpegoptim optipng pngquant gifsicle locales libonig-dev supervisor nano cron \
&& docker-php-ext-configure gd \
&& docker-php-ext-install gd \
&& apt-get install -y --no-install-recommends libgmp-dev \
&& docker-php-ext-install gmp \
&& docker-php-ext-install pdo_mysql mbstring bcmath pcntl \
&& docker-php-ext-install pdo \
&& docker-php-ext-enable opcache \
&& docker-php-ext-install zip \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/pear/ \
&& curl -sL https://deb.nodesource.com/setup_12.x | bash \
&& apt-get install nodejs \
&& node -v \
&& npm -v
RUN apt-get install -y --no-install-recommends \
imagemagick \
libmagickwand-dev
RUN pecl install imagick; \
docker-php-ext-enable imagick
# Install redis
RUN pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis
# Copy files
COPY . /var/www
COPY ./deploy/php/php.ini /usr/local/etc/php/php.ini
COPY ./deploy/php/php-pool /usr/local/etc/php-fpm.d
COPY ./.env.example /var/www/.env
COPY ./deploy/nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./deploy/supervisor/conf.d /etc/supervisor/conf.d
# Set permissions
RUN chown -R www-data:www-data /var/www
RUN chgrp -R www-data /var/www
RUN chown -R www-data:www-data /var/www/storage
# Setup npm
RUN npm install --force
RUN npm rebuild node-sass
RUN npm run prod
# Setup composer and laravel
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer install --working-dir="/var/www"
RUN composer dump-autoload -o --working-dir="/var/www"
RUN php artisan config:clear
RUN php artisan config:cache
RUN php artisan event:cache
# RUN php artisan migrate --force
EXPOSE 8080
ENTRYPOINT ["/usr/bin/supervisord","-c","/etc/supervisor/conf.d/supervisord.conf"]