This repository was archived by the owner on Mar 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
88 lines (70 loc) 路 2.43 KB
/
Copy pathDockerfile
File metadata and controls
88 lines (70 loc) 路 2.43 KB
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
83
84
85
86
87
88
FROM php:7-fpm
MAINTAINER "duck @ theBIGGAME" <me@duck.me.uk>
ARG EVENT_NUMBER
ENV APP_EVENTID ${EVENT_NUMBER}
ENV PATH="$PATH:/var/www/vendor/bin"
# install some dependencies / crap we need
RUN apt-get update \
&& apt-get install -y \
gnupg2 \
curl \
&& curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& apt-get install -y \
nodejs \
libmcrypt-dev \
libfreetype6 libjpeg-dev libfreetype6-dev libpng-dev \
libxrender1 \
wget \
git \
nginx \
supervisor \
zip \
unzip
# notes:
# NPROC is done so we build PHP extensions with all available cores, dramatically reducing compile time (especially for gd)
# we grab prestissimo because it multi-threads composer downloads basically for free
# Apparently mcrypt is no longer supported so has to be enabled manually
RUN pecl install mcrypt-1.0.2 \
docker-php-ext-enable mcrypt \
&& docker-php-ext-install -j$(nproc) \
bcmath \
gd \
mbstring \
mysqli \
pdo_mysql \
opcache \
pcntl \
&& docker-php-ext-configure gd \
--enable-gd-native-ttf \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& chown -R www-data:www-data /var/lib/nginx \
&& chown -R www-data:www-data /var/www \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \
&& composer global require "hirak/prestissimo:^0.3"
# configuration
ADD ./docker/php.ini /usr/local/etc/php/conf.d/php-fpm.ini
ADD ./docker/supervisord.conf /etc/supervisord.conf
ADD ./docker/nginx.conf /etc/nginx/nginx.conf
# create app dir
RUN mkdir -p /var/www
# we copy some basic package management files here to cut down on layer changes
COPY ./composer.json ./composer.lock ./package.json ./gulpfile.js /var/www/
WORKDIR /var/www
# needed to make autoloader work properly
COPY ./database /var/www/database
RUN /usr/bin/composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader \
&& npm install --production
COPY . /var/www/
# RUN /usr/bin/gulp --production
RUN chown -R www-data:www-data \
/var/www/storage \
/var/www/bootstrap/cache \
&& chmod +x \
/var/www/docker/launch.sh
EXPOSE 80
CMD /usr/bin/supervisord -c /etc/supervisord.conf