forked from slm0n87/docker-gsales
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (44 loc) · 1.92 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
FROM mariusheise/php-web:7.3-apache-sapi
MAINTAINER Marius Heise <[email protected]>
ENV EMPTY_STRING ""
ENV PHP_VERSION 7.3
ENV GSALES_REVISION 1154
ENV GSALES_HOME /var/www/gsales
ENV RUN_SCRIPTS 1
# Install wget
RUN apt-get update -qq && \
apt-get install -y \
wget && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
# Install ioncube loader
RUN cd /tmp \
&& wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -qO - | tar xfvz - \
&& mkdir /usr/local/ioncube/ \
&& mv ioncube/ioncube_loader_lin_${PHP_VERSION}.so /usr/local/ioncube/ \
&& rm -rf ioncube \
&& echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" > /etc/php/7.3/cli/php.ini \
&& echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" > /etc/php/7.3/apache2/php.ini
# redirect apache logs
RUN find /etc/apache2 -type f -exec sed -ri ' \
s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \
' '{}' ';'
# install gsales conf
COPY gsales.conf /etc/apache2/sites-available/gsales.conf
# Download g*Sales
SHELL ["/bin/bash", "-c"]
RUN mkdir -p ${GSALES_HOME} \
&& export GSALES_DOWNLOAD_URL=https://www.gsales.de/download/gsales2-rev${GSALES_REVISION}-php${PHP_VERSION/./$EMPTY_STRING}.tar.gz \
&& echo ${GSALES_DOWNLOAD_URL} \
&& wget ${GSALES_DOWNLOAD_URL} -qO - | tar --strip=1 -xzC ${GSALES_HOME}
SHELL ["/bin/sh", "-c"]
# Enable and add sites
RUN a2dissite 000-default && \
a2ensite gsales
EXPOSE 80
COPY docker-entrypoint.sh /usr/local/sbin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/sbin/docker-entrypoint.sh"]
VOLUME ["${GSALES_HOME}/DATA"]
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]