forked from tuxgasy/docker-dolibarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
94 lines (79 loc) · 2.64 KB
/
Dockerfile.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
ARG ARCH=
FROM ${ARCH}php:%PHP_BASE_IMAGE%
LABEL maintainer="Garcia MICHEL <[email protected]>"
ENV DOLI_VERSION %DOLI_VERSION%
ENV DOLI_INSTALL_AUTO 1
ENV DOLI_PROD 1
ENV DOLI_DB_TYPE mysqli
ENV DOLI_DB_HOST mysql
ENV DOLI_DB_HOST_PORT 3306
ENV DOLI_DB_NAME dolidb
ENV DOLI_URL_ROOT 'http://localhost'
ENV DOLI_NOCSRFCHECK 0
ENV DOLI_AUTH dolibarr
ENV DOLI_LDAP_HOST 127.0.0.1
ENV DOLI_LDAP_PORT 389
ENV DOLI_LDAP_VERSION 3
ENV DOLI_LDAP_SERVER_TYPE openldap
ENV DOLI_LDAP_LOGIN_ATTRIBUTE uid
ENV DOLI_LDAP_DN 'ou=users,dc=my-domain,dc=com'
ENV DOLI_LDAP_FILTER ''
ENV DOLI_LDAP_BIND_DN ''
ENV DOLI_LDAP_BIND_PASS ''
ENV DOLI_LDAP_DEBUG false
ENV DOLI_CRON 0
ENV WWW_USER_ID 33
ENV WWW_GROUP_ID 33
ENV PHP_INI_DATE_TIMEZONE 'UTC'
ENV PHP_INI_MEMORY_LIMIT 256M
ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M
ENV PHP_INI_POST_MAX_SIZE 8M
ENV PHP_INI_ALLOW_URL_FOPEN 0
RUN sed -i \
-e 's/^\(ServerSignature On\)$/#\1/g' \
-e 's/^#\(ServerSignature Off\)$/\1/g' \
-e 's/^\(ServerTokens\) OS$/\1 Prod/g' \
/etc/apache2/conf-available/security.conf
RUN apt-get update -y \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
libc-client-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libldap2-dev \
libpng-dev \
libpq-dev \
libxml2-dev \
libzip-dev \
default-mysql-client \
postgresql-client \
cron \
&& apt-get autoremove -y \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \
&& docker-php-ext-configure pgsql -with-pgsql \
&& docker-php-ext-install pdo_pgsql pgsql \
&& docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \
&& docker-php-ext-install -j$(nproc) ldap \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install imap \
&& mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \
&& rm -rf /var/lib/apt/lists/*
# Get Dolibarr
RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\
tar -C /tmp -xz && \
cp -r /tmp/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && \
ln -s /var/www/html /var/www/htdocs && \
cp -r /tmp/dolibarr-${DOLI_VERSION}/scripts /var/www/ && \
rm -rf /tmp/* && \
mkdir -p /var/www/documents && \
mkdir -p /var/www/html/custom && \
chown -R www-data:www-data /var/www
EXPOSE 80
VOLUME /var/www/documents
VOLUME /var/www/html/custom
COPY docker-init.php /var/www/scripts/
COPY docker-run.sh /usr/local/bin/
ENTRYPOINT ["docker-run.sh"]
CMD ["apache2-foreground"]