-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 1.43 KB
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 1.43 KB
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
FROM debian:jessie
MAINTAINER Pierre-Antoine 'ZHAJOR' Tible <antoinetible@gmail.com>
RUN apt-get update
RUN apt-get -y install apache2 libapache2-mod-php5 php5 php5-pgsql postgresql-9.4 postgresql-client-9.4 postgresql-contrib wget unzip
RUN apt-get clean
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
RUN ln -sf /dev/stdout /var/log/apache2/access.log
RUN ln -sf /dev/stdout /var/log/apache2/error.log
RUN chown -R www-data:www-data /var/log/apache2 /var/www/html
WORKDIR /var/www/html
RUN wget https://github.com/phppgadmin/phppgadmin/archive/master.zip
RUN rm /var/www/html/index.html && unzip /var/www/html/master.zip
RUN cp -R phppgadmin-master/* . && rm -r phppgadmin-master
RUN cp conf/config.inc.php-dist conf/config.inc.php
RUN sed -i "s/\$conf\['extra_login_security'\] = true;/\$conf\['extra_login_security'\] = false;/g" conf/config.inc.php
RUN sed -i "s/\$conf\['servers'\]\[0\]\['host'\] = '';/\$conf\['servers'\]\[0\]\['host'\] = 'localhost';/g" conf/config.inc.php
RUN service postgresql start; \
su - postgres -c "/usr/lib/postgresql/9.4/bin/psql -U postgres -c \"ALTER USER postgres with password 'postgres';\""
RUN sed -i "s/\#listen_addresses = 'localhost'/listen_addresses = '\*'/g" /etc/postgresql/9.4/main/postgresql.conf
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.4/main/pg_hba.conf
ADD run.sh /run.sh
RUN chmod -v +x /run.sh
EXPOSE 5432
EXPOSE 80
CMD ["/run.sh"]