-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (50 loc) · 1.81 KB
/
Dockerfile
File metadata and controls
60 lines (50 loc) · 1.81 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
FROM php:7.1-apache
MAINTAINER ilovintit <ilovintit@gmail.com>
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libmemcached-dev \
zlib1g-dev \
libltdl7 \
libltdl-dev \
libpq-dev \
libsqlite3-dev \
git \
curl \
libcurl3-dev \
rsyslog \
cron \
supervisor \
unzip \
libicu-dev \
--no-install-recommends \
&& docker-php-ext-install -j$(nproc) iconv mcrypt pdo_mysql pdo_pgsql pdo_sqlite zip curl\
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
RUN pecl install apcu memcached mongodb redis \
&& docker-php-ext-enable apcu memcached mongodb redis
RUN mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/supervisor
#安装nodejs和yarn
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y nodejs yarn
#安装composer
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/bin --filename=composer
#配置apache
RUN a2enmod ssl rewrite
RUN { \
echo '<VirtualHost *:80>';\
echo 'ServerAdmin webmaster@localhost';\
echo 'DocumentRoot /var/www/html';\
echo 'ErrorLog ${APACHE_LOG_DIR}/error.log';\
echo 'CustomLog ${APACHE_LOG_DIR}/access.log combined';\
echo 'SetEnv HTTPS ${FORCE_HTTPS}';\
echo '</VirtualHost>';\
} > /etc/apache2/sites-available/000-default.conf
ENV HTTPS off
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
RUN echo "export FORCE_HTTPS=\${HTTPS}" >> /etc/apache2/envvars