This repository has been archived by the owner on Feb 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
67 lines (58 loc) · 2.67 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
56
57
58
59
60
61
62
63
64
65
66
67
# phppgadmin in a container
#
# docker run -rm -i -d \
# -p 80 \
# -e APACHE_SERVERNAME=example.com \
# -e POSTGRES_HOST=localhost \
# -e POSTGRES_PORT=5432 \
# -v /etc/localtime:/etc/localtime \
# einfallstoll/phppgadmin
FROM debian:jessie
MAINTAINER Fabio Poloni "[email protected]"
# Update the package repository
RUN DEBIAN_FRONTEND=noninteractive apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -yqq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yqq wget curl
# Added dotdeb to apt and install PHP
RUN echo "deb http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list.d/dotdeb.org.list && \
echo "deb-src http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list.d/dotdeb.org.list && \
wget -O- http://www.dotdeb.org/dotdeb.gpg | apt-key add - && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
php5-cli php5 php5-mcrypt php5-curl php5-pgsql postgresql-contrib phppgadmin && \
curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer && \
sed -i 's/;include_path = ".:\/usr\/share\/php"/include_path = ".:\/var\/www\/library"/g' /etc/php5/cli/php.ini && \
sed -i 's/\;include_path = ".:\/usr\/share\/php"/include_path = ".:\/var\/www\/library"/g' /etc/php5/apache2/php.ini && \
a2enmod rewrite
# Fix phppgadmin
COPY ./phppgadmin.conf /etc/apache2/conf.d/phppgadmin
COPY ./phppgadmin.conf /etc/apache2/conf-available/phppgadmin.conf
COPY ./config.inc.php /usr/share/phppgadmin/conf/config.inc.php
COPY ./config.inc.php /etc/phppgadmin/config.inc.php
RUN sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/g' /etc/php5/apache2/php.ini
# Fix phppgadmin's code which produces too many errors in apache's error.log
RUN sed -i "s/\$plugins = \$conf\['plugins'\]\;/\$plugins = \!empty(\$conf\['plugins'\])\?\$conf\['plugins'\]:\[\]\;/g" /usr/share/phppgadmin/classes/PluginManager.php
# Include auto-login
COPY ./login.inc.php /var/tmp/login.inc.php
COPY inject-login.sh /inject-login.sh
RUN ["bash", "inject-login.sh"]
# Clean image
RUN apt-get -yqq clean && \
apt-get -yqq purge && \
rm -rf /tmp/* /var/tmp/* && \
rm -rf /var/lib/apt/lists/*
# Set Apache environment variables (can be changed on docker run with -e)
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_SERVERADMIN admin@localhost
ENV APACHE_SERVERNAME localhost
ENV POSTGRES_DEFAULTDB postgres
ENV POSTGRES_HOST localhost
ENV POSTGRES_PORT 5432
EXPOSE 80 443
COPY start.sh /start.sh
CMD ["bash", "start.sh"]