Skip to content

Commit

Permalink
feat: add sitemap support with a new parameter POLINFO_BASURL needed …
Browse files Browse the repository at this point in the history
…by sitemap
  • Loading branch information
kerphi committed Feb 7, 2025
1 parent acce74e commit a477efe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# initialize default values for parameters
export POLINFO_BASEURL=${POLINFO_BASEURL:='https://politique-informatique.abes.fr'}

# patch sitemap because it needs to have the absolute url
if [ ! -f /usr/share/nginx/html/sitemap.xml.orig ]; then
cp -f /usr/share/nginx/html/sitemap.xml /usr/share/nginx/html/sitemap.xml.orig
fi
sed "s#https://politique_developpement_abes_baseurl_placeholder#${POLINFO_BASEURL}#g" \
/usr/share/nginx/html/sitemap.xml.orig \
> /usr/share/nginx/html/sitemap.xml

# Pass control to the main process
exec "$@"
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ FROM nginx:1.25 as politique-developpement-image
# Copy what we've installed/built from production
COPY --from=build-image /app/build /usr/share/nginx/html/
COPY ./.docker/nginx-default.conf.template /etc/nginx/templates/default.conf.template
COPY ./.docker/docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
EXPOSE 80

0 comments on commit a477efe

Please sign in to comment.