Skip to content

Commit

Permalink
use the bitnami/apache base image because it doesn't use root
Browse files Browse the repository at this point in the history
  • Loading branch information
jonenst committed Dec 8, 2023
1 parent f6d4a14 commit f126078
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM httpd:2.4
FROM bitnami/apache:2.4.55-debian-11-r3@sha256:bbe50190eb3bbf3be6f61318004480b3230846bfd52dec9286bd1862254c1719

RUN echo "Include conf/app-httpd.conf" >> /usr/local/apache2/conf/httpd.conf
COPY app-httpd.conf /usr/local/apache2/conf/
COPY build /usr/local/apache2/htdocs/gridXXX
RUN sed -i -e 's;<base href="\./"/>;<base href="<!--#echo var="BASE" -->"/>;' /usr/local/apache2/htdocs/gridXXX/index.html
USER root
COPY app-httpd.conf /opt/bitnami/apache/conf/bitnami/bitnami.conf
COPY build /opt/bitnami/apache/htdocs/gridXXX
RUN sed -i -e 's;<base href="\./"/>;<base href="<!--#echo var="BASE" -->"/>;' /opt/bitnami/apache/htdocs/gridXXX/index.html
USER 1001
8 changes: 4 additions & 4 deletions app-httpd.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<VirtualHost *:80>
<VirtualHost *:8080>
AllowEncodedSlashes NoDecode

LoadModule proxy_module modules/mod_proxy.so
Expand All @@ -8,9 +8,9 @@
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so

DocumentRoot /usr/local/apache2/htdocs/gridXXX/
DocumentRoot /opt/bitnami/apache/htdocs/gridXXX/
AddOutputFilterByType INCLUDES text/html
<Directory /usr/local/apache2/htdocs/gridXXX/>
<Directory /opt/bitnami/apache/htdocs/gridXXX/>
Options +Includes
</Directory>

Expand All @@ -22,7 +22,7 @@
RewriteEngine On
RewriteMap remapbase "prg:/bin/sed -u -e 's;[^ ]* ;;' -e 's;[ ?].*;;' -e 's;[^/]*;..;g' -e 's;../..;;' -e 's/.//' -e 's;^$;.;'"

RewriteCond /usr/local/apache2/htdocs/gridXXX%{REQUEST_URI} -f [OR]
RewriteCond /opt/bitnami/apache/htdocs/gridXXX%{REQUEST_URI} -f [OR]
RewriteCond %{REQUEST_URI} ^/api/.* [OR]
RewriteCond %{REQUEST_URI} ^/ws/.*
RewriteRule ^ - [S=2]
Expand Down

0 comments on commit f126078

Please sign in to comment.