Spaces:
Build error
Build error
| FROM miller3456/nextcloud-edited:latest | |
| # 1. Port Setup | |
| EXPOSE 7860 | |
| RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf && \ | |
| sed -i 's/:80>/:7860>/' /etc/apache2/sites-available/000-default.conf | |
| # 2. Environment Overrides | |
| ENV OVERWRITEPROTOCOL=https | |
| ENV APACHE_PORT=7860 | |
| # 3. Comprehensive Fix Script | |
| # This handles Trusted Domains, Frames, and Proxy settings all at once | |
| RUN echo '<?php \ | |
| $CONFIG = array ( \ | |
| "trusted_domains" => array(0 => "localhost", 1 => "*.hf.space", 2 => "huggingface.co"), \ | |
| "overwritehost" => $_SERVER["HTTP_X_FORWARDED_HOST"] ?? "", \ | |
| "overwriteprotocol" => "https", \ | |
| "overwritewebroot" => "/", \ | |
| "frame_ancestors" => array("https://*.hf.space", "https://huggingface.co"), \ | |
| );' > /var/www/html/config/huggingface.config.php | |
| # Ensure Nextcloud includes our custom config | |
| RUN echo "include('/var/www/html/config/huggingface.config.php');" >> /var/www/html/config/config.php |