Skip to content

Instantly share code, notes, and snippets.

@shtrom
Last active April 25, 2023 08:37

Revisions

  1. shtrom revised this gist Apr 25, 2023. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions ssi-extractor.Dockerfile
    Original file line number Diff line number Diff line change
    @@ -17,9 +17,9 @@ RUN sed -i \
    && rm /usr/local/apache2/htdocs/index.html

    RUN mkdir /out \
    && echo '#!/bin/sh' > /entrypoint.sh \
    && echo 'httpd-foreground &' >> /entrypoint.sh \
    && echo 'sleep 3; cd /out; wget -rl 0 -nH -E --accept-regex "/[^.]*(.html)?$" http://localhost/' >> /entrypoint.sh \
    && chmod a+x /entrypoint.sh
    && echo '#!/bin/sh' > /cmd.sh \
    && echo 'httpd-foreground &' >> /cmd.sh \
    && echo 'sleep 3; cd /out; wget -rl 0 -nH -E --accept-regex "/[^.]*(.html)?$" http://localhost/' >> /cmd.sh \
    && chmod a+x /cmd.sh

    CMD ["/entrypoint.sh"]
    CMD ["/cmd.sh"]
  2. shtrom revised this gist Apr 24, 2023. No changes.
  3. shtrom created this gist Apr 24, 2023.
    25 changes: 25 additions & 0 deletions ssi-extractor.Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    # usage:
    #
    # docker build -t ssi-extractor - < Dockerfile
    # docker run -v ./www:/usr/local/apache2/htdocs/ -v ./out:/out ssi-extractor
    FROM httpd:alpine

    RUN apk update \
    && apk add wget

    RUN sed -i \
    -e 's/#LoadModule include_module/LoadModule include_module/' \
    -e 's/#LoadModule negotiation_module/LoadModule negotiation_module/' \
    -e 's/Options Indexes FollowSymLinks/& Includes MultiViews/' \
    -e 's/#\(Add.*shtml\)/\1/' \
    -e 's/DirectoryIndex index.html/DirectoryIndex index.shtml/' \
    /usr/local/apache2/conf/httpd.conf \
    && rm /usr/local/apache2/htdocs/index.html

    RUN mkdir /out \
    && echo '#!/bin/sh' > /entrypoint.sh \
    && echo 'httpd-foreground &' >> /entrypoint.sh \
    && echo 'sleep 3; cd /out; wget -rl 0 -nH -E --accept-regex "/[^.]*(.html)?$" http://localhost/' >> /entrypoint.sh \
    && chmod a+x /entrypoint.sh

    CMD ["/entrypoint.sh"]