FROM caddy:2-alpine # Install required tools for hash calculation RUN apk add --no-cache bash coreutils findutils grep sed xxd perl gawk # Copy update scripts first COPY update-csp-hashes.sh /srv/update-csp-hashes.sh COPY caddy.sh /srv/caddy.sh # Copy Caddyfile and static content COPY Caddyfile /etc/caddy/Caddyfile COPY index.html /srv/ COPY theme.js /srv/ COPY utils.js /srv/ COPY styles.css /srv/ COPY favicon.ico /srv/ # Copy one-pager-tools directory COPY one-pager-tools /srv/one-pager-tools/ # Set working directory WORKDIR /srv # Run the update-csp-hashes.sh script to update CSP hashes RUN chmod +x /srv/caddy.sh /srv/update-csp-hashes.sh && \ cd /srv && \ ./update-csp-hashes.sh # Expose port 8080 EXPOSE 8080 # Run Caddy CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]