Commit 819bea59 authored by pierrecdn's avatar pierrecdn
Browse files

Initial commit

parent faf4b78a
FROM php:5.6-apache
MAINTAINER Pierre Cheynier <pierre.cheynier@sfr.com>
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 && \
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 && \
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 && \
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
# docker-phpipam
phpIPAM is an open-source web IP address management application. Its goal is to provide light and simple IP address management application.
phpIPAM is developed and maintained by Miha Petkovsek, released under the GPL v3 license, project source is [here](https://github.com/phpipam/phpipam)
Learn more on [phpIPAM homepage](http://phpipam.net)
![phpIPAM logo](http://phpipam.net/wp-content/uploads/2014/12/phpipam_logo_small@2x.png)
## How to use this Docker image
### Mysql
Run a MySQL database, dedicated to phpipam
```bash
$ docker run --name phpipam-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -v /my_dir/phpipam:/var/lib/mysql -d mysql:5.6
```
Here, we store data on the host system under [`/my_dir/phpipam`] and use a specific root password.
### Phpipam
```bash
$ docker run -ti -d -p 80:80 --name ipam --link phpipam-mysql:mysql phpipam
```
We are linking the two containers and expose the HTTP port.
### Specific integration (HTTPS, multi-host containers, etc.)
Regarding your requirements and docker setup, you've to expose resources.
For HTTPS, run a reverse-proxy in front of your phpipam container and link it to.
For multi-host containers, expose ports, run etcd or consul to make service discovery works etc.
### Configuration
* Browse to `http://<ip>[:<specific_port>]/`
* Step 1 : Choose 'Automatic database installation'
![step1](https://cloud.githubusercontent.com/assets/4225738/8746785/01758b9e-2c8d-11e5-8643-7f5862c75efe.png)
* Step 2 : Re-Enter connection information
![step2](https://cloud.githubusercontent.com/assets/4225738/8746789/0ad367e2-2c8d-11e5-80bb-f5093801e139.png)
* Note that these two first steps could be swapped by patching phpipam (see https://github.com/phpipam/phpipam/issues/25)
* Step 3 : Configure the admin user password
![step3](https://cloud.githubusercontent.com/assets/4225738/8746790/0c434bf6-2c8d-11e5-9ae7-b7d1021b7aa0.png)
* You're done !
![done](https://cloud.githubusercontent.com/assets/4225738/8746792/0d6fa34e-2c8d-11e5-8002-3793361ae34d.png)
### Notes
phpIPAM is under heavy development by the amazing Miha.
To upgrade the release version, just change the `PHPIPAM_VERSION` environment variable to the target release (see https://github.com/phpipam/phpipam/releases)
[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
serialize_precision = 17
zend.enable_gc = On
expose_php = On
max_execution_time = 30
max_input_time = 60
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = On
log_errors = On
log_errors_max_len = 1024
default_mimetype = "text/html"
default_charset = "UTF-8"
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[Date]
date.timezone = "US/Central"
[mail function]
smtp_port = 25
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[ldap]
ldap.max_links = -1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment