Dockerfile 2.03 KB
Newer Older
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
FROM debian

RUN apt update -y
RUN apt upgrade -y

RUN apt install apache2 -y
RUN apt install apache2 libapache2-mod-php -y
RUN apt install wget -y
RUN apt install openssl -y

#apache2 setup
RUN mkdir -p /var/lock/apache2
RUN mkdir -p /var/run/apache2
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_LOG_DIR /var/log/apache2
ENV LANG C



## We need ssl to get this going, i will use a self signed certificate.
RUN openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout /etc/ssl/private/self.key -out /etc/ssl/certs/self.crt -su$
RUN ls /etc/ssl/certs | grep self
RUN ls /etc/ssl/private | grep self

RUN rm /etc/apache2/sites-available/default-ssl.conf
#May need to stop service before removing
COPY cfg/default-ssl.conf /etc/apache2/sites-available
RUN chown www-data:www-data /etc/ssl/private/self.key
RUN chown www-data:www-data /etc/ssl/certs/self.crt
RUN a2enmod ssl
RUN a2enmod headers
RUN a2ensite default-ssl
#RUN /etc/init.d/apache2 reload


#getting simplSAML

RUN wget https://simplesamlphp.org/download?latest
RUN tar xzf download?latest
RUN mv simplesamlphp* /var/simplesamlphp

#dependencies
RUN apt install php-curl php-xml -y
#config
RUN rm /var/simplesamlphp/config/config.php
RUN rm /var/simplesamlphp/config/authsources.php
COPY cfg/config.php /var/simplesamlphp/config
COPY cfg/authsources.php /var/simplesamlphp/config
#RUN /etc/init.d/apache2 reload
#RUN cd /var/simplesamlphp/cert
RUN openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout /var/simplesamlphp/cert/idp.pem -out /var/simplesamlphp/ce$
RUN chown www-data /var/simplesamlphp/cert/idp.pem
RUN chown www-data /var/simplesamlphp/cert/idp.crt

#Ready metadata:
#RUN rm/var/simplesamlphp/metadata/saml20-idp-hosted.php
#RUN rm/var/simplesamlphp/metadata/saml20-sp-remote.php

COPY cfg/saml20-idp-hosted.php /var/simplesamlphp/metadata
COPY cfg/saml20-sp-remote.php /var/simplesamlphp/metadata


CMD ["/usr/sbin/apache2","-D","FOREGROUND"]
EXPOSE 80 443