-
Notifications
You must be signed in to change notification settings - Fork 44
/
Dockerfile.nocache
79 lines (70 loc) · 2.39 KB
/
Dockerfile.nocache
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
# First stage, install composer and its dependencies and fetch vendor files
FROM alpine:3.7
RUN apk --no-cache add \
php5 \
php5-dom \
php5-phar \
php5-gd \
php5-iconv \
php5-json \
php5-mysql \
php5-openssl \
php5-xml \
php5-zlib \
php5-curl \
curl
RUN mkdir /app && mkdir /app/pleio && curl -sS https://getcomposer.org/installer | php5 -- --install-dir=/usr/local/bin --filename=composer
RUN ln -s /usr/bin/php5 /usr/bin/php
WORKDIR /app
COPY composer.json composer.json /app/
COPY mod/pleio/composer.json /app/pleio/
ARG COMPOSER_ALLOW_SUPERUSER=1
ARG COMPOSER_NO_INTERACTION=1
RUN composer install
WORKDIR /app/pleio
RUN composer install
# Second stage, build usable container
FROM alpine:3.7
LABEL maintainer="Luc Belliveau <[email protected]>"
RUN \
apk --no-cache add \
apache2 \
php5 \
php5-apache2 \
php5-ctype \
php5-curl \
php5-dom \
php5-gd \
php5-iconv \
php5-json \
php5-mysql \
php5-xml \
php5-curl \
curl \
&& apk update \
&& apk --no-cache add php5-mysqli \
&& mkdir -p /var/www/html/vendor \
&& mkdir -p /data \
&& mkdir -p /run/apache2 \
&& chown apache /data \
&& ln -s /dev/stderr /var/log/apache2/error.log \
&& ln -s /dev/stdout /var/log/apache2/access.log \
&& sed -i '/#LoadModule rewrite_module modules\/mod_rewrite.so/c\LoadModule rewrite_module modules\/mod_rewrite.so' /etc/apache2/httpd.conf \
&& sed -i '/DocumentRoot "\/var\/www\/localhost\/htdocs"/c\DocumentRoot "\/var\/www\/html"' /etc/apache2/httpd.conf \
&& sed -i '/Options Indexes FollowSymLinks/c\\' /etc/apache2/httpd.conf \
&& sed -i '/AllowOverride None/c\\' /etc/apache2/httpd.conf \
&& sed -i '/Options Indexes FollowSymLinks/c\\' /etc/apache2/httpd.conf \
&& sed -i '/<Directory "\/var\/www\/localhost\/htdocs">/c\<Directory "\/var\/www\/html">\nDirectoryIndex index.php\nOptions FollowSymLinks MultiViews\nAllowOverride All\nOrder allow,deny\nallow from all\n' /etc/apache2/httpd.conf
COPY ./install/config/htaccess.dist /var/www/html/.htaccess
COPY --from=0 /app/vendor/ /var/www/html/vendor/
COPY . /var/www/html
COPY --from=0 /app/pleio/vendor/ /var/www/html/mod/pleio/vendor/
RUN chown apache:apache /var/www/html
WORKDIR /var/www/html
EXPOSE 80
EXPOSE 443
RUN chmod +x docker/start.sh
# Start Apache in foreground mode
RUN rm -f /run/apache2/httpd.pid
ENTRYPOINT [ "docker/start.sh" ]
CMD ["/usr/sbin/httpd -D FOREGROUND"]