-
Notifications
You must be signed in to change notification settings - Fork 0
/
DockerfileApacheService
114 lines (85 loc) · 3.36 KB
/
DockerfileApacheService
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Utilisation de l'image Ubuntu 20.04
FROM ubuntu:20.04
# Set timezone
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN if [ -f ./deploy_configuration/.env_proxy ]; then \
# Si le fichier source existe, copiez-le
COPY ./deploy_configuration/.env_proxy /; \
fi
COPY ./deploy_configuration/proxy.sh /
RUN chmod +x /proxy.sh
RUN sh /proxy.sh
ARG HTTP_PROXY_CI
ENV http_proxy=$HTTP_PROXY_CI
ENV https_proxy=$HTTP_PROXY_CI
ENV HTTP_PROXY=$HTTP_PROXY_CI
ENV HTTPS_PROXY=$HTTP_PROXY_CI
# Vérifiez si la variable d'environnement http_proxy est définie
RUN if [ -n "$http_proxy" ]; then \
# Si elle est définie, exécutez les commandes pour configurer le proxy
touch /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTP::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::HTTPS::Prox "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo 'Acquire::ftp::Proxy "'$http_proxy'";' >> /etc/apt/apt.conf.d/05proxy; \
echo "Proxy configuré dans le système de packages avec la valeur $http_proxy" && true; \
fi
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apache2 apache2-bin libapache2-mod-fcgid
COPY ./deploy_configuration/shibconf/shibboleth/packages.sh /
RUN chmod u+x /packages.sh
RUN apt-get install -y expect
RUN sh /packages.sh
RUN apt-get install -y apache2
RUN apt-get install -y libapache2-mod-shib2
RUN apt-get install -y supervisor
## Paquets pour le wayf
RUN apt-get install -y imagemagick
RUN apt-get install -y python3 python3-pip
RUN pip3 install lxml
RUN apt-get install -y libxml2-utils
RUN apt-get install -y unzip
RUN apt-get install -y wget
COPY ./deploy_configuration/apache/template-000-default.conf /
COPY ./deploy_configuration/apache/template-default-ssl.conf /
COPY ./deploy_configuration/apache/replace_env.sh /
### Configuration WayF
RUN apt-get install -y php7.4-fpm php7.4-common php7.4-xml php7.4-mbstring libapache2-mod-php php-curl
RUN a2enmod proxy_fcgi setenvif
RUN mkdir /wayf
WORKDIR /wayf
##RUN wget https://gitlab.switch.ch/gip-renater/SWITCHwayf/-/archive/1.22-0001/SWITCHwayf-1.22-0001.tar.gz
##RUN tar xvzf SWITCHwayf-1.22-0001.tar.gz -C /opt/
##RUN ln -s /opt/SWITCHwayf-1.22-0001 /opt/switchwayf
##RUN chmod -R go=u-w /opt/switchwayf
WORKDIR /
###Fin Config WayF
COPY ./deploy_configuration/shibconf/shibboleth/supervisord.conf /
RUN mkdir -p /var/cache/shibboleth
RUN a2enmod shib
RUN a2enmod rewrite actions proxy proxy_fcgi setenvif
COPY ./deploy_configuration/shibconf/files_conf/security.conf /etc/apache2/conf-available
COPY ./deploy_configuration/shibconf/files_conf/shib.conf /etc/apache2/conf-available
COPY ./deploy_configuration/shibconf/files_conf/wayf.conf /etc/apache2/conf-available
COPY ./deploy_configuration/shibconf/files_conf/ports.conf /etc/apache2
RUN a2enconf security
RUN a2enconf wayf
COPY ./switchwayf /var/www/html/switchwayf
RUN chmod -R go=u-w /var/www/html/switchwayf
RUN apt-get install -y cron
RUN apt-get install -y supervisor
RUN apt-get install -y gettext-base
RUN a2ensite 000-default
RUN a2ensite default-ssl
RUN mkdir /var/www/html/smile
WORKDIR /var/www/html/smile/
COPY ./src /var/www/html/smile/
WORKDIR /var/www/html/smile/public
ENV HTTP_PROXY ""
ENV HTTPS_PROXY ""
ENV http_proxy ""
ENV https_proxy ""
RUN rm -f /etc/apt/apt.conf.d/05proxy
EXPOSE 80
EXPOSE 443