Download Dockerfile from zipusyan/dnss: direct link, hf CLI and curl.
- Browser
- Download file 2.72 kB
-
https://huggingface.co/spaces/zipusyan/dnss/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/zipusyan/dnss/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/zipusyan/dnss/resolve/main/Dockerfile
2.72 kB
| FROM alpine:3.19 | |
| # Install all dependencies | |
| RUN apk add --no-cache \ | |
| mariadb mariadb-client \ | |
| nginx \ | |
| php82 php82-fpm \ | |
| php82-pdo php82-pdo_mysql php82-mysqli \ | |
| php82-mbstring php82-curl php82-openssl php82-json \ | |
| php82-tokenizer php82-xml php82-ctype php82-bcmath \ | |
| php82-fileinfo php82-gd php82-zip php82-phar \ | |
| php82-session php82-dom php82-simplexml php82-xmlwriter \ | |
| php82-iconv php82-posix php82-pcntl \ | |
| supervisor \ | |
| curl unzip \ | |
| && ln -sf /usr/bin/php82 /usr/bin/php \ | |
| && sed -i 's/skip-networking/#skip-networking/' /etc/my.cnf.d/mariadb-server.cnf | |
| # Download dnsmgr release | |
| RUN curl -fSL -o /tmp/dnsmgr.zip https://github.com/netcccyun/dnsmgr/releases/download/2.18/dnsmgr_2.18.zip \ | |
| && unzip -q /tmp/dnsmgr.zip -d /tmp/dnsmgr \ | |
| && mkdir -p /app/www \ | |
| && cp -r /tmp/dnsmgr/* /app/www/ \ | |
| && cp -r /tmp/dnsmgr/.??* /app/www/ \ | |
| && rm -rf /tmp/dnsmgr.zip /tmp/dnsmgr | |
| # Configure nginx | |
| COPY nginx.conf /etc/nginx/http.d/default.conf | |
| # Configure php-fpm | |
| RUN sed -i 's/;daemonize\s*=\s*yes/daemonize = no/' /etc/php82/php-fpm.conf \ | |
| && sed -i 's/listen\s*=\s*127.0.0.1:9000/listen = \/run\/php\/php8.2-fpm.sock/' /etc/php82/php-fpm.d/www.conf \ | |
| && sed -i 's/^user = nobody/user = nginx/' /etc/php82/php-fpm.d/www.conf \ | |
| && sed -i 's/^group = nobody/group = nginx/' /etc/php82/php-fpm.d/www.conf \ | |
| && sed -i 's/;listen.owner\s*=\s*nobody/listen.owner = nginx/' /etc/php82/php-fpm.d/www.conf \ | |
| && sed -i 's/;listen.group\s*=\s*nobody/listen.group = nginx/' /etc/php82/php-fpm.d/www.conf \ | |
| && echo "php_admin_value[error_log] = /proc/self/fd/2" >> /etc/php82/php-fpm.d/www.conf \ | |
| && echo "php_admin_flag[log_errors] = on" >> /etc/php82/php-fpm.d/www.conf \ | |
| && echo "php_admin_value[display_errors] = stdout" >> /etc/php82/php-fpm.d/www.conf \ | |
| && echo "php_admin_value[error_reporting] = E_ALL" >> /etc/php82/php-fpm.d/www.conf \ | |
| && mkdir -p /run/php | |
| # Configure supervisord | |
| COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
| # Copy entrypoint script | |
| COPY entrypoint.sh /entrypoint.sh | |
| RUN chmod +x /entrypoint.sh | |
| # Create required directories | |
| RUN mkdir -p /run/nginx /run/mysqld /var/lib/mysql /var/log/mariadb /var/log/supervisor \ | |
| && mkdir -p /app/www/runtime/temp /app/www/runtime/cache /app/www/runtime/session /app/www/runtime/log \ | |
| && mkdir -p /app/www/public/storage \ | |
| && chown -R mysql:mysql /var/lib/mysql /var/log/mariadb /run/mysqld \ | |
| && chown -R nginx:nginx /app/www \ | |
| && chown -R nginx:nginx /run/php \ | |
| && chmod -R 755 /app/www/runtime | |
| EXPOSE 8081 | |
| ENTRYPOINT ["/entrypoint.sh"] | |
| CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] | |