-
Notifications
You must be signed in to change notification settings - Fork 62
/
Dockerfile.main.template
80 lines (68 loc) · 3.07 KB
/
Dockerfile.main.template
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
FROM php:%%PHP_VERSION%%-apache
LABEL maintainer="Francesco Bianco <info@javanile.org>"
ENV LAYER_BREAK=true
ENV VT_VERSION="%%VT_VERSION%%" \
DATABASE_PACKAGE="%%DATABASE_PACKAGE%%" \
COMPOSER_HOME=/usr/src/vtiger \
PATH="/usr/src/vtiger/vendor/bin:$PATH"
COPY php.ini /usr/local/etc/php/
COPY vtiger.json .symvol /usr/src/vtiger/
COPY vtiger-ssl.* /etc/apache2/ssl/
COPY 000-default.conf /etc/apache2/sites-available/
RUN apt-get update && \
apt-get install --no-install-recommends -y zlib1g-dev libc-client-dev libkrb5-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxml2-dev cron rsyslog zip unzip socat vim nano && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-install imap exif mysqli pdo pdo_mysql zip gd xml && \
echo "cron.* /var/log/cron.log" >> /etc/rsyslog.conf && rm -fr /etc/cron.* && mkdir /etc/cron.d && ${LAYER_BREAK}
RUN curl -o composer -sL https://getcomposer.org/composer.phar && \
php composer global require javanile/http-robot:0.0.2 javanile/mysql-import:0.0.15 javanile/vtiger-cli:0.0.4 && \
php composer clearcache && rm composer && ${LAYER_BREAK}
RUN curl -sL https://javanile.github.io/symvol/setup.sh?v=0.0.2 | bash - && ${LAYER_BREAK}
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data && \
echo "ServerName localhost" >> /etc/apache2/apache2.conf && \
a2enmod ssl && a2enmod rewrite && ${LAYER_BREAK}
RUN cd /usr/src/vtiger && \
curl -o vtiger.tar.gz -L "%%VT_DOWNLOAD%%" && \
tar -xzf vtiger.tar.gz && \
rm vtiger.tar.gz && \
rm -fr /var/www/html && \
mv "%%VT_DIRECTORY%%" /var/www/html && \
vtiger permissions --fix && \
mv .symvol /var/www/html && \
mkdir -p volume /var/lib/vtiger && ${LAYER_BREAK}
RUN apt-get clean && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*
## @block: develop
COPY develop-install.sh /usr/local/bin/
RUN develop-install.sh
#COPY vtiger-install.sh /usr/local/bin/
#COPY vtiger-install.php /usr/src/vtiger/
## @block: release
COPY vtiger-*.sh /usr/local/bin/
COPY vtiger-*.php /usr/src/vtiger/
## @endblock
## @block: develop
#RUN vtiger-install.sh --assert-mysql --dump --remove-mysql
#COPY vtiger-foreground.sh /usr/local/bin/
#COPY vtiger-functions.php /usr/src/vtiger/
## @block: release
RUN vtiger-install.sh --install-mysql --assert-mysql --dump --remove-mysql && ${LAYER_BREAK}
## @endblock
RUN cd /var/www/html/vtlib/Vtiger/ && \
sed -e 's!realpath(!__realpath__(!' -ri Utils.php Deprecated.php && \
symvol move /var/www/html /usr/src/vtiger/volume
COPY config.inc.php /usr/src/vtiger/
COPY LoggerManager.php /var/www/html/libraries/log4php/
COPY config.performance.php health.php loading.php /var/www/html/
COPY crontab /etc/
VOLUME ["/var/lib/vtiger"]
WORKDIR /app
ENV VT_ADMIN_USER="admin" \
VT_ADMIN_PASSWORD="admin" \
VT_ADMIN_EMAIL="admin@localhost.lan" \
VT_CURRENCY_NAME="USA, Dollars" \
VT_SCHEDULER=1 \
VT_INSTALL=1 \
MYSQL_HOST="mysql" \
MYSQL_DATABASE="vtiger"
CMD ["vtiger-foreground.sh"]