From 827e28f7482c3d875f3e12720363cb26d024fd21 Mon Sep 17 00:00:00 2001 From: diegogtus <37963695+diegogtus@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:54:12 -0600 Subject: [PATCH 1/4] Add files via upload --- DiegoDominguez/Dockerfile | 47 +++++++++++++++++++++++++++++++++ DiegoDominguez/default | 17 ++++++++++++ DiegoDominguez/start.sh | 2 ++ DiegoDominguez/supervisord.conf | 34 ++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 DiegoDominguez/Dockerfile create mode 100644 DiegoDominguez/default create mode 100644 DiegoDominguez/start.sh create mode 100644 DiegoDominguez/supervisord.conf diff --git a/DiegoDominguez/Dockerfile b/DiegoDominguez/Dockerfile new file mode 100644 index 0000000..84bc2e9 --- /dev/null +++ b/DiegoDominguez/Dockerfile @@ -0,0 +1,47 @@ +# Download base image ubuntu 20.04 +FROM ubuntu:20.04 + +# LABEL about the custom image +LABEL maintainer="admin@sysadminjournal.com" +LABEL version="0.1" +LABEL description="This is custom Docker Image for \ +the PHP-FPM and Nginx Services." + +# Disable Prompt During Packages Installation +ARG DEBIAN_FRONTEND=noninteractive + +# Update Ubuntu Software repository +RUN apt update + +# Install nginx, php-fpm and supervisord from ubuntu repository +RUN apt install -y nginx php-fpm supervisor && \ + rm -rf /var/lib/apt/lists/* && \ + apt clean + +# Define the ENV variable +ENV nginx_vhost /etc/nginx/sites-available/default +ENV php_conf /etc/php/7.4/fpm/php.ini +ENV nginx_conf /etc/nginx/nginx.conf +ENV supervisor_conf /etc/supervisor/supervisord.conf + +# Enable PHP-fpm on nginx virtualhost configuration +COPY default ${nginx_vhost} +RUN sed -i -e 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' ${php_conf} && \ + echo "\ndaemon off;" >> ${nginx_conf} + +# Copy supervisor configuration +COPY supervisord.conf ${supervisor_conf} + +RUN mkdir -p /run/php && \ + chown -R www-data:www-data /var/www/html && \ + chown -R www-data:www-data /run/php + +# Volume configuration +VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] + +# Copy start.sh script and define default command for the container +COPY start.sh /start.sh +CMD ["./start.sh"] + +# Expose Port for the Application +EXPOSE 80 443 \ No newline at end of file diff --git a/DiegoDominguez/default b/DiegoDominguez/default new file mode 100644 index 0000000..5e604ec --- /dev/null +++ b/DiegoDominguez/default @@ -0,0 +1,17 @@ +server { + listen 80 default_server; + + root /var/www/html; + index index.html index.htm index.nginx-debian.html; + + server_name _; + + location / { + try_files $uri $uri/ =404; + } + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.4-fpm.sock; + } +} \ No newline at end of file diff --git a/DiegoDominguez/start.sh b/DiegoDominguez/start.sh new file mode 100644 index 0000000..b5bb82f --- /dev/null +++ b/DiegoDominguez/start.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf \ No newline at end of file diff --git a/DiegoDominguez/supervisord.conf b/DiegoDominguez/supervisord.conf new file mode 100644 index 0000000..6058cfb --- /dev/null +++ b/DiegoDominguez/supervisord.conf @@ -0,0 +1,34 @@ +[unix_http_server] +file=/dev/shm/supervisor.sock ; (the path to the socket file) + +[supervisord] +logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log) +logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) +logfile_backups=10 ; (num of main logfile rotation backups;default 10) +loglevel=info ; (log level;default info; others: debug,warn,trace) +pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +nodaemon=false ; (start in foreground if true;default false) +minfds=1024 ; (min. avail startup file descriptors;default 1024) +minprocs=200 ; (min. avail process descriptors;default 200) +user=root ; + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL for a unix socket + +[include] +files = /etc/supervisor/conf.d/*.conf + +[program:php-fpm7.4] +command=/usr/sbin/php-fpm7.4 -F +numprocs=1 +autostart=true +autorestart=true + +[program:nginx] +command=/usr/sbin/nginx +numprocs=1 +autostart=true +autorestart=true \ No newline at end of file From bca41f3b54d80d0fccb869f72187c4b76429c5ec Mon Sep 17 00:00:00 2001 From: diegogtus <37963695+diegogtus@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:54:48 -0600 Subject: [PATCH 2/4] Delete DiegoDominguez directory --- DiegoDominguez/Dockerfile | 47 --------------------------------- DiegoDominguez/default | 17 ------------ DiegoDominguez/start.sh | 2 -- DiegoDominguez/supervisord.conf | 34 ------------------------ 4 files changed, 100 deletions(-) delete mode 100644 DiegoDominguez/Dockerfile delete mode 100644 DiegoDominguez/default delete mode 100644 DiegoDominguez/start.sh delete mode 100644 DiegoDominguez/supervisord.conf diff --git a/DiegoDominguez/Dockerfile b/DiegoDominguez/Dockerfile deleted file mode 100644 index 84bc2e9..0000000 --- a/DiegoDominguez/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -# Download base image ubuntu 20.04 -FROM ubuntu:20.04 - -# LABEL about the custom image -LABEL maintainer="admin@sysadminjournal.com" -LABEL version="0.1" -LABEL description="This is custom Docker Image for \ -the PHP-FPM and Nginx Services." - -# Disable Prompt During Packages Installation -ARG DEBIAN_FRONTEND=noninteractive - -# Update Ubuntu Software repository -RUN apt update - -# Install nginx, php-fpm and supervisord from ubuntu repository -RUN apt install -y nginx php-fpm supervisor && \ - rm -rf /var/lib/apt/lists/* && \ - apt clean - -# Define the ENV variable -ENV nginx_vhost /etc/nginx/sites-available/default -ENV php_conf /etc/php/7.4/fpm/php.ini -ENV nginx_conf /etc/nginx/nginx.conf -ENV supervisor_conf /etc/supervisor/supervisord.conf - -# Enable PHP-fpm on nginx virtualhost configuration -COPY default ${nginx_vhost} -RUN sed -i -e 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' ${php_conf} && \ - echo "\ndaemon off;" >> ${nginx_conf} - -# Copy supervisor configuration -COPY supervisord.conf ${supervisor_conf} - -RUN mkdir -p /run/php && \ - chown -R www-data:www-data /var/www/html && \ - chown -R www-data:www-data /run/php - -# Volume configuration -VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] - -# Copy start.sh script and define default command for the container -COPY start.sh /start.sh -CMD ["./start.sh"] - -# Expose Port for the Application -EXPOSE 80 443 \ No newline at end of file diff --git a/DiegoDominguez/default b/DiegoDominguez/default deleted file mode 100644 index 5e604ec..0000000 --- a/DiegoDominguez/default +++ /dev/null @@ -1,17 +0,0 @@ -server { - listen 80 default_server; - - root /var/www/html; - index index.html index.htm index.nginx-debian.html; - - server_name _; - - location / { - try_files $uri $uri/ =404; - } - - location ~ \.php$ { - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/run/php/php7.4-fpm.sock; - } -} \ No newline at end of file diff --git a/DiegoDominguez/start.sh b/DiegoDominguez/start.sh deleted file mode 100644 index b5bb82f..0000000 --- a/DiegoDominguez/start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf \ No newline at end of file diff --git a/DiegoDominguez/supervisord.conf b/DiegoDominguez/supervisord.conf deleted file mode 100644 index 6058cfb..0000000 --- a/DiegoDominguez/supervisord.conf +++ /dev/null @@ -1,34 +0,0 @@ -[unix_http_server] -file=/dev/shm/supervisor.sock ; (the path to the socket file) - -[supervisord] -logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log) -logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) -logfile_backups=10 ; (num of main logfile rotation backups;default 10) -loglevel=info ; (log level;default info; others: debug,warn,trace) -pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) -nodaemon=false ; (start in foreground if true;default false) -minfds=1024 ; (min. avail startup file descriptors;default 1024) -minprocs=200 ; (min. avail process descriptors;default 200) -user=root ; - -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL for a unix socket - -[include] -files = /etc/supervisor/conf.d/*.conf - -[program:php-fpm7.4] -command=/usr/sbin/php-fpm7.4 -F -numprocs=1 -autostart=true -autorestart=true - -[program:nginx] -command=/usr/sbin/nginx -numprocs=1 -autostart=true -autorestart=true \ No newline at end of file From 33c0995f07cf2f53642fba0dc5caf9accb10f9a7 Mon Sep 17 00:00:00 2001 From: diegogtus <37963695+diegogtus@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:55:05 -0600 Subject: [PATCH 3/4] Add files via upload --- Clase 1/DiegoDominguez/Dockerfile | 47 +++++++++++++++++++++++++ Clase 1/DiegoDominguez/default | 17 +++++++++ Clase 1/DiegoDominguez/start.sh | 2 ++ Clase 1/DiegoDominguez/supervisord.conf | 34 ++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 Clase 1/DiegoDominguez/Dockerfile create mode 100644 Clase 1/DiegoDominguez/default create mode 100644 Clase 1/DiegoDominguez/start.sh create mode 100644 Clase 1/DiegoDominguez/supervisord.conf diff --git a/Clase 1/DiegoDominguez/Dockerfile b/Clase 1/DiegoDominguez/Dockerfile new file mode 100644 index 0000000..84bc2e9 --- /dev/null +++ b/Clase 1/DiegoDominguez/Dockerfile @@ -0,0 +1,47 @@ +# Download base image ubuntu 20.04 +FROM ubuntu:20.04 + +# LABEL about the custom image +LABEL maintainer="admin@sysadminjournal.com" +LABEL version="0.1" +LABEL description="This is custom Docker Image for \ +the PHP-FPM and Nginx Services." + +# Disable Prompt During Packages Installation +ARG DEBIAN_FRONTEND=noninteractive + +# Update Ubuntu Software repository +RUN apt update + +# Install nginx, php-fpm and supervisord from ubuntu repository +RUN apt install -y nginx php-fpm supervisor && \ + rm -rf /var/lib/apt/lists/* && \ + apt clean + +# Define the ENV variable +ENV nginx_vhost /etc/nginx/sites-available/default +ENV php_conf /etc/php/7.4/fpm/php.ini +ENV nginx_conf /etc/nginx/nginx.conf +ENV supervisor_conf /etc/supervisor/supervisord.conf + +# Enable PHP-fpm on nginx virtualhost configuration +COPY default ${nginx_vhost} +RUN sed -i -e 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' ${php_conf} && \ + echo "\ndaemon off;" >> ${nginx_conf} + +# Copy supervisor configuration +COPY supervisord.conf ${supervisor_conf} + +RUN mkdir -p /run/php && \ + chown -R www-data:www-data /var/www/html && \ + chown -R www-data:www-data /run/php + +# Volume configuration +VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] + +# Copy start.sh script and define default command for the container +COPY start.sh /start.sh +CMD ["./start.sh"] + +# Expose Port for the Application +EXPOSE 80 443 \ No newline at end of file diff --git a/Clase 1/DiegoDominguez/default b/Clase 1/DiegoDominguez/default new file mode 100644 index 0000000..5e604ec --- /dev/null +++ b/Clase 1/DiegoDominguez/default @@ -0,0 +1,17 @@ +server { + listen 80 default_server; + + root /var/www/html; + index index.html index.htm index.nginx-debian.html; + + server_name _; + + location / { + try_files $uri $uri/ =404; + } + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.4-fpm.sock; + } +} \ No newline at end of file diff --git a/Clase 1/DiegoDominguez/start.sh b/Clase 1/DiegoDominguez/start.sh new file mode 100644 index 0000000..b5bb82f --- /dev/null +++ b/Clase 1/DiegoDominguez/start.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf \ No newline at end of file diff --git a/Clase 1/DiegoDominguez/supervisord.conf b/Clase 1/DiegoDominguez/supervisord.conf new file mode 100644 index 0000000..6058cfb --- /dev/null +++ b/Clase 1/DiegoDominguez/supervisord.conf @@ -0,0 +1,34 @@ +[unix_http_server] +file=/dev/shm/supervisor.sock ; (the path to the socket file) + +[supervisord] +logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log) +logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) +logfile_backups=10 ; (num of main logfile rotation backups;default 10) +loglevel=info ; (log level;default info; others: debug,warn,trace) +pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +nodaemon=false ; (start in foreground if true;default false) +minfds=1024 ; (min. avail startup file descriptors;default 1024) +minprocs=200 ; (min. avail process descriptors;default 200) +user=root ; + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL for a unix socket + +[include] +files = /etc/supervisor/conf.d/*.conf + +[program:php-fpm7.4] +command=/usr/sbin/php-fpm7.4 -F +numprocs=1 +autostart=true +autorestart=true + +[program:nginx] +command=/usr/sbin/nginx +numprocs=1 +autostart=true +autorestart=true \ No newline at end of file From 83b7dd7ab3fab389af76e24caf60875034b5fc89 Mon Sep 17 00:00:00 2001 From: HblGit <112965909+HblGit@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:06:46 -0600 Subject: [PATCH 4/4] Add files via upload --- Clase 1/Tarea Hansel Barrascout/Archivos/index.php | 3 +++ Clase 1/Tarea Hansel Barrascout/Dockerfile | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 Clase 1/Tarea Hansel Barrascout/Archivos/index.php create mode 100644 Clase 1/Tarea Hansel Barrascout/Dockerfile diff --git a/Clase 1/Tarea Hansel Barrascout/Archivos/index.php b/Clase 1/Tarea Hansel Barrascout/Archivos/index.php new file mode 100644 index 0000000..7a5bb1b --- /dev/null +++ b/Clase 1/Tarea Hansel Barrascout/Archivos/index.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Clase 1/Tarea Hansel Barrascout/Dockerfile b/Clase 1/Tarea Hansel Barrascout/Dockerfile new file mode 100644 index 0000000..ee272e7 --- /dev/null +++ b/Clase 1/Tarea Hansel Barrascout/Dockerfile @@ -0,0 +1,3 @@ +FROM php:7.2-apache +COPY ./Archivos/ /var/www/html/ +EXPOSE 80