diff --git a/Dockerfile b/Dockerfile index 21e4b67..d920493 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ FROM docker.charlyghislain.com/front-apache:2.4.39-a ARG CLANG=en -ADD docker/httpd.conf /var/run/httpd/charlyghislaindotcom.conf ADD dist/${CLANG} /var/www/ +ADD docker/httpd.conf /var/run/httpd.conf.tmp +RUN apk add gettext \ + && mkdir /var/run/httpd \ + && cat /var/run/httpd.conf.tmp | envsubst > /var/run/httpd/charlyghislaindotcom.conf ENV LANG=$CLANG HEALTHCHECK --interval=10s --timeout=3s \ diff --git a/docker/httpd.conf b/docker/httpd.conf index b70a31d..1c5d597 100644 --- a/docker/httpd.conf +++ b/docker/httpd.conf @@ -13,14 +13,11 @@ DocumentRoot /var/www RewriteRule ^ - [L] # If for an existing subpath, redirect to index - RewriteCond %{REQUEST_URI} "^/en/" - RewriteRule ^ /en/index.html [L] - - RewriteCond %{REQUEST_URI} "^/fr/" - RewriteRule ^ /fr/index.html [L] + RewriteCond %{REQUEST_URI} "^/${CLANG}/" + RewriteRule ^ /${CLANG}/index.html [L] # If the requested resource doesn't exist, use index.html - RewriteRule ^ /fr/ [L,R] + RewriteRule ^ /${CLANG}/ [L,R]