/
Dockerfile
68 lines (57 loc) · 2.17 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
FROM php:7.4.33-apache
ADD https://github.com/mlocati/docker-php-extension-installer/releases/download/1.5.29/install-php-extensions /usr/local/bin/
WORKDIR /var/www
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libicu-dev \
libpq-dev \
ca-certificates \
ssl-cert \
libcurl4-gnutls-dev \
git \
unzip \
mariadb-client \
wget \
supervisor \
cron \
libzip-dev \
zip \
&& update-ca-certificates \
&& chmod +x /usr/local/bin/install-php-extensions \
&& install-php-extensions \
pdo_mysql \
mbstring \
opcache \
intl \
curl \
zip \
gd \
iconv \
&& apt-get autoremove \
&& rm -r /var/lib/apt/lists/* \
&& mkdir -p /var/log/supervisor
COPY apache-conf /etc/apache2/sites-available
COPY crontab /etc/cron.d/supla-cron
COPY php.ini /usr/local/etc/php/conf.d/php-supla.ini
RUN ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \
&& { \
echo 'ServerTokens Prod\n'; \
echo 'ServerSignature Off\n'; \
} >> /etc/apache2/apache2.conf \
&& a2enmod headers rewrite expires deflate ssl cgi alias env \
&& chmod 0644 /etc/cron.d/supla-cron
ENV CLOUD_VERSION=24.03
#COPY supla-cloud.tar.gz ./supla-cloud-v$CLOUD_VERSION.tar.gz
RUN a2ensite default-ssl \
&& wget -nc https://github.com/SUPLA/supla-cloud/releases/download/v${CLOUD_VERSION}/supla-cloud-v${CLOUD_VERSION}.tar.gz \
&& mkdir cloud \
&& tar -xzf supla-cloud-v${CLOUD_VERSION}.tar.gz -C cloud \
&& rm -f supla-cloud-v${CLOUD_VERSION}.tar.gz \
&& sed -i "s+/var/run/supla/supla-server-ctrl.sock+/supla-server/supla-server-ctrl.sock+g" cloud/app/config/config.yml \
&& chown -hR www-data:www-data cloud
WORKDIR /var/www/cloud
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY cloud-entrypoint.sh /usr/local/bin/docker-php-entrypoint
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=30s \
CMD wget --no-verbose --tries=1 --spider http://localhost/api/server-info || exit 1
CMD ["/usr/bin/supervisord", "--nodaemon", "--configuration", "/etc/supervisor/conf.d/supervisord.conf"]