-
Notifications
You must be signed in to change notification settings - Fork 44
/
Dockerfile
95 lines (81 loc) · 2.69 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
83
84
85
86
87
88
89
90
91
92
93
94
95
# 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 && mkdir /app/paas_integration && 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/
COPY mod/paas_integration/composer.json /app/paas_integration/
ARG COMPOSER_ALLOW_SUPERUSER=1
ARG COMPOSER_NO_INTERACTION=1
RUN composer config --no-plugins allow-plugins.composer/installers true
RUN composer install
WORKDIR /app/pleio
RUN composer install
# Second stage, build usable container
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
&& apt-get clean \
&& rm -fr /var/lib/apt/lists/*
RUN add-apt-repository ppa:ondrej/php
RUN apt-get update && apt-get install -y --no-install-recommends \
apache2 \
curl \
memcached \
libapache2-mod-php5.6 \
php5.6 \
php5.6-gd \
php5.6-mbstring \
php5.6-json \
php5.6-mysql \
php5.6-zip \
php5.6-xml \
php5.6-curl \
php5.6-opcache \
php5.6-memcache \
&& apt-get clean \
&& rm -fr /var/lib/apt/lists/* \
&& mkdir -p /var/www/html/vendor \
&& mkdir -p /data \
&& chown www-data /data \
&& ln -sf /dev/stderr /var/log/apache2/error.log \
&& ln -sf /dev/stdout /var/log/apache2/access.log
RUN a2enmod rewrite headers
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
echo 'opcache.enable_file_override=1'; \
} > /etc/php/5.6/apache2/conf.d/opcache-recommended.ini
COPY ./docker/000-default.conf /etc/apache2/sites-available/000-default.conf
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/
COPY ./docker/settings.env.php /var/www/html/engine/settings.php
RUN chown www-data:www-data /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 ["apache2ctl -D FOREGROUND"]