Top

Welcome!

Learning

PHP

GO

More...

  • Misc. stuff on W3Schools
  • Docker tutorial
  • Linux sockets
  • Very basic container (Dockerfile)

    FROM golang:1.22.7-alpine
    RUN apk update && apk upgrade
    RUN apk add curl
    RUN apk add sudo
    RUN apk add php-fpm
    RUN apk add nginx
    RUN apk add mc
    RUN apk add vim
    ENV NGINX_PID_FILE=/run/nginx/nginx.pid
    RUN touch ${NGINX_PID_FILE}
    RUN  sed -i 's/;listen.owner = nobody/listen.owner = nginx/' /etc/php83/php-fpm.d/www.conf
    RUN  sed -i 's/;listen.group = nobody/listen.group = nginx/' /etc/php83/php-fpm.d/www.conf
    RUN  sed -i 's/user = nobody/user = nginx/' /etc/php83/php-fpm.d/www.conf
    RUN  sed -i 's/group = nobody/group = nginx/' /etc/php83/php-fpm.d/www.conf
    RUN  sed -i 's/listen = 127.0.0.1:9000/listen = \/run\/php-fpm.sock/' /etc/php83/php-fpm.d/www.conf
    RUN echo "server {\
        listen 80;\
        listen [::]:80;\
        error_log /var/log/nginx/vhosts.log debug;\
        server_name ~^(?<domain>.*)\$;\
        root /var/www/\$domain/htdocs;\
        location / {\
                rewrite ^(.*)$ / break;\
                try_files index.php?\$query_string =404;\
        }\
        location ~ ^/(.*?((\.css)|(\.js)|(\.png)|(\.ico)|(\.jpg)|(\.gif)|(\.html)))$ {\
               try_files $uri \$uri/ /\$1 =404;\
        }\
        location ~ /$ {\
            include fastcgi_params;\
            include fastcgi.conf;\
            fastcgi_index index.php;\
            fastcgi_pass unix:/run/php-fpm.sock;\
        }\
    }" > /etc/nginx/http.d/vhosts.conf
    WORKDIR /
    RUN echo "<?php echo \"Hello from PHP \" . phpversion() . \"\n\";" > /var/www/localhost/htdocs/index.php
    RUN mkdir scripts
    RUN echo "php-fpm83 && nginx && curl localhost" > /scripts/test.sh && chmod +x /scripts/test.sh
    CMD ["sh", "/scripts/test.sh"]
    

    1. Create file named Dockerfile and paste code above
    2. Build docker image by running docker build . -t vbc
    3. Run docker container by executing docker run --rm -it vbc and you should see Hello from PHP 8.3.15


    calculator

    calculator.git

    decisionTable

    decisionTable.git

    messageboard

    messageboard.git

    tpms-api

    tpms-api.git

    ytv

    ytv.git