forked from pierrecdn/phpipam
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
41 lines (33 loc) · 1.55 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
FROM php:5.6-apache
MAINTAINER Pierre Cheynier <[email protected]>
ENV PHPIPAM_SOURCE https://github.com/phpipam/phpipam/archive/
ENV PHPIPAM_VERSION 1.16.003
# Install required deb packages
RUN apt-get update && \
apt-get install -y git php-pear php5-curl php5-mysql php5-json php5-gmp php5-mcrypt php5-ldap libgmp-dev libmcrypt-dev libldap2-dev && \
rm -rf /var/lib/apt/lists/*
# Configure apache and required PHP modules
RUN docker-php-ext-configure mysqli --with-mysqli=mysqlnd && \
docker-php-ext-install mysqli && \
docker-php-ext-install pdo_mysql && \
docker-php-ext-install gettext && \
docker-php-ext-install pcntl && \
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h && \
docker-php-ext-configure gmp --with-gmp=/usr/include/x86_64-linux-gnu && \
docker-php-ext-install gmp && \
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
docker-php-ext-install ldap && \
docker-php-ext-install mcrypt && \
echo ". /etc/environment" >> /etc/apache2/envvars && \
a2enmod rewrite
COPY php.ini /usr/local/etc/php/
# copy phpipam sources to web dir
ADD ${PHPIPAM_SOURCE}/${PHPIPAM_VERSION}.tar.gz /tmp/
RUN tar -xzf /tmp/${PHPIPAM_VERSION}.tar.gz -C /var/www/html/ --strip-components=1
# Use system environment variables into config.php
RUN sed -i \
-e "s/\['host'\] = \"localhost\"/\['host'\] = \"mysql\"/" \
-e "s/\['user'\] = \"phpipam\"/\['user'\] = \"root\"/" \
-e "s/\['pass'\] = \"phpipamadmin\"/\['pass'\] = getenv(\"MYSQL_ENV_MYSQL_ROOT_PASSWORD\")/" \
/var/www/html/config.php
EXPOSE 80