|
16 | 16 | FROM --platform=$TARGETPLATFORM centos:7 |
17 | 17 |
|
18 | 18 | #install HTTPD |
19 | | -RUN yum -y update |
20 | | -RUN yum -y install httpd mod_ssl procps haproxy iputils tree telnet |
| 19 | +RUN yum -y update && yum -y install httpd mod_ssl procps haproxy iputils tree telnet && yum clean all |
21 | 20 |
|
22 | 21 | #remove default CentOS config |
23 | | -RUN rm -rf /etc/httpd/conf/* |
24 | | -RUN rm -rf /etc/httpd/conf.d/* |
25 | | -RUN rm -rf /etc/httpd/conf.modules.d/* |
| 22 | +RUN rm -rf /etc/httpd/conf/* && rm -rf /etc/httpd/conf.d/* && rm -rf /etc/httpd/conf.modules.d/* |
26 | 23 |
|
27 | 24 | #Copy the AMS base files into the image. |
28 | 25 | COPY ams/2.6/etc/httpd /etc/httpd |
29 | | -RUN mkdir /etc/httpd/conf.d/enabled_vhosts |
30 | | -RUN ln -s /etc/httpd/conf.d/available_vhosts/aem_author.vhost /etc/httpd/conf.d/enabled_vhosts/aem_author.vhost |
31 | | -RUN ln -s /etc/httpd/conf.d/available_vhosts/aem_flush_author.vhost /etc/httpd/conf.d/enabled_vhosts/aem_flush_author.vhost |
32 | | -RUN ln -s /etc/httpd/conf.d/available_vhosts/aem_publish.vhost /etc/httpd/conf.d/enabled_vhosts/aem_publish.vhost |
33 | | -RUN ln -s /etc/httpd/conf.d/available_vhosts/aem_flush.vhost /etc/httpd/conf.d/enabled_vhosts/aem_flush.vhost |
34 | | -RUN ln -s /etc/httpd/conf.d/available_vhosts/aem_health.vhost /etc/httpd/conf.d/enabled_vhosts/aem_health.vhost |
35 | | - |
36 | | -RUN mkdir /etc/httpd/conf.dispatcher.d/enabled_farms |
37 | | -RUN ln -s /etc/httpd/conf.dispatcher.d/available_farms/000_ams_catchall_farm.any /etc/httpd/conf.dispatcher.d/enabled_farms/000_ams_catchall_farm.any |
38 | | -RUN ln -s /etc/httpd/conf.dispatcher.d/available_farms/001_ams_author_flush_farm.any /etc/httpd/conf.dispatcher.d/enabled_farms/001_ams_author_flush_farm.any |
39 | | -RUN ln -s /etc/httpd/conf.dispatcher.d/available_farms/001_ams_publish_flush_farm.any /etc/httpd/conf.dispatcher.d/enabled_farms/001_ams_publish_flush_farm.any |
40 | | -RUN ln -s /etc/httpd/conf.dispatcher.d/available_farms/002_ams_author_farm.any /etc/httpd/conf.dispatcher.d/enabled_farms/002_ams_author_farm.any |
41 | | - |
42 | 26 | # Setup sample configs |
43 | 27 | COPY sample/weretail_filters.any /etc/httpd/conf.dispatcher.d/filters/weretail_filters.any |
44 | 28 | COPY sample/weretail_publish_farm.any /etc/httpd/conf.dispatcher.d/available_farms/100_weretail_publish_farm.any |
45 | | -RUN ln -s /etc/httpd/conf.dispatcher.d/available_farms/100_weretail_publish_farm.any /etc/httpd/conf.dispatcher.d/enabled_farms/100_weretail_publish_farm.any |
46 | 29 |
|
47 | 30 | # Install dispatcher |
48 | 31 | ARG TARGETARCH |
49 | 32 | COPY scripts/setup.sh / |
50 | 33 | RUN chmod +x /setup.sh |
| 34 | +# ensuring correct file ending on windows systems |
| 35 | +RUN sed -i -e 's/\r\n/\n/' /setup.sh |
51 | 36 | RUN ./setup.sh |
52 | 37 | RUN rm /setup.sh |
53 | 38 |
|
54 | | -# Create default docroots |
55 | | -RUN mkdir -p /mnt/var/www/html |
56 | | -RUN chown apache:apache /mnt/var/www/html |
57 | | - |
58 | | -RUN mkdir -p /mnt/var/www/default |
59 | | -RUN chown apache:apache /mnt/var/www/default |
60 | | - |
61 | | -RUN mkdir -p /mnt/var/www/author |
62 | | -RUN chown apache:apache /mnt/var/www/author |
63 | | - |
64 | | -# Setup SSL |
65 | | -RUN mkdir -p /etc/ssl/docker && \ |
66 | | - openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=GB/ST=London/L=London/O=Adobe/CN=localhost" \ |
67 | | - -keyout /etc/ssl/docker/localhost.key \ |
68 | | - -out /etc/ssl/docker/localhost.crt && \ |
69 | | - cat /etc/ssl/docker/localhost.key /etc/ssl/docker/localhost.crt > /etc/ssl/docker/haproxy.pem |
70 | | - |
71 | | -COPY haproxy/haproxy.cfg /etc/haproxy |
72 | 39 |
|
73 | 40 | COPY scripts/launch.sh / |
| 41 | +# ensuring correct file ending on windows systems |
| 42 | +RUN sed -i -e 's/\r\n/\n/' /launch.sh |
74 | 43 | RUN chmod +x /launch.sh |
75 | 44 |
|
76 | 45 | COPY LICENSE / |
|
0 commit comments