forked from glats/docker-lamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (60 loc) · 2.38 KB
/
Dockerfile
File metadata and controls
68 lines (60 loc) · 2.38 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
FROM alpine:3.12.3
ENV TIMEZONE Asia/Jakarta
RUN apk update && apk upgrade
RUN apk add mariadb mariadb-client \
apache2 \
apache2-utils \
curl wget \
tzdata \
php7-apache2 \
php7-apcu \
php7-bz2 \
php7-cli \
php7-ctype \
php7-curl \
php7-dom \
php7-fileinfo \
php7-gd \
php7-iconv \
php7-intl \
php7-json \
php7-mbstring \
php7-mcrypt \
php7-mysqli \
php7-opcache \
php7-openssl \
php7-pdo_mysql \
php7-phar \
php7-session \
php7-tokenizer \
php7-xml \
php7-xmlreader \
php7-xmlwriter \
php7-simplexml \
php7-zip \
php7-zlib
RUN curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/bin --filename=composer
# configure timezone, mysql, apache
RUN cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \
echo "${TIMEZONE}" > /etc/timezone && \
mkdir -p /run/mysqld && chown -R mysql:mysql /run/mysqld /var/lib/mysql && \
mkdir -p /run/apache2 && chown -R apache:apache /run/apache2 && chown -R apache:apache /var/www/localhost/htdocs/ && \
sed -i 's#\#LoadModule rewrite_module modules\/mod_rewrite.so#LoadModule rewrite_module modules\/mod_rewrite.so#' /etc/apache2/httpd.conf && \
sed -i 's#ServerName www.example.com:80#\nServerName localhost:80#' /etc/apache2/httpd.conf && \
sed -i 's/skip-networking/\#skip-networking/i' /etc/my.cnf.d/mariadb-server.cnf && \
sed -i '/mariadb\]/a log_error = \/var\/lib\/mysql\/error.log' /etc/my.cnf.d/mariadb-server.cnf && \
sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/my.cnf.d/mariadb-server.cnf && \
sed -i '/mariadb\]/a skip-external-locking' /etc/my.cnf.d/mariadb-server.cnf && \
sed -i '/mariadb\]/a general_log = ON' /etc/my.cnf.d/mariadb-server.cnf && \
sed -i '/mariadb\]/a general_log_file = \/var\/lib\/mysql\/query.log' /etc/my.cnf.d/mariadb-server.cnf
RUN sed -i 's#upload_max_filesize = 2M#upload_max_filesize = 100M#' /etc/php7/php.ini && \
sed -i 's#post_max_size = 8M#post_max_size = 100M#' /etc/php7/php.ini && \
sed -i 's#session.cookie_httponly =#session.cookie_httponly = true#' /etc/php7/php.ini && \
sed -i 's#error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT#error_reporting = 0#' /etc/php7/php.ini
COPY entry.sh /entry.sh
RUN chmod u+x /entry.sh
WORKDIR /var/www/localhost/htdocs/
EXPOSE 80
EXPOSE 3306
ENTRYPOINT ["/entry.sh"]