diff --git a/.gitignore b/.gitignore index 8012272..2b5a589 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ # Credenciales locales — nunca commitear pagos/api/config.php + +# Assets generados (se descargan al hacer docker compose build) +pagos/js/tailwind.cdn.js diff --git a/Dockerfile b/Dockerfile index 56a87ea..3b28c2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,14 @@ FROM php:8.2-fpm-alpine -RUN apk add --no-cache sqlite sqlite-dev \ - && docker-php-ext-install pdo pdo_sqlite +RUN apk add --no-cache sqlite sqlite-dev curl \ + && docker-php-ext-install pdo pdo_sqlite \ + && curl -sL "https://cdn.tailwindcss.com?plugins=forms,container-queries" \ + -o /tmp/tailwind.cdn.js WORKDIR /var/www/html + +COPY docker/entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] diff --git a/docker-compose.yml b/docker-compose.yml index 5bb0267..87578d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,7 @@ services: volumes: - ./pagos:/var/www/html - ./docker/nginx.conf:/etc/nginx/conf.d/default.conf + - ./docker/htpasswd:/etc/nginx/.htpasswd:ro depends_on: - app networks: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..da3c48d --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Copiar tailwind.cdn.js al directorio servido si no existe +if [ ! -f /var/www/html/js/tailwind.cdn.js ]; then + cp /tmp/tailwind.cdn.js /var/www/html/js/tailwind.cdn.js +fi +exec "$@" diff --git a/docker/htpasswd b/docker/htpasswd new file mode 100644 index 0000000..f12f6cc --- /dev/null +++ b/docker/htpasswd @@ -0,0 +1 @@ +root:$apr1$69HFcTHn$9hHiieirPfFe3M.lo87O21 diff --git a/docker/nginx.conf b/docker/nginx.conf index 544634f..de7c45a 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -5,6 +5,9 @@ server { resolver 127.0.0.11 valid=10s; + auth_basic "Quiet Wealth"; + auth_basic_user_file /etc/nginx/.htpasswd; + location / { try_files $uri $uri/ =404; } @@ -15,6 +18,8 @@ server { fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PHP_AUTH_USER $remote_user; + fastcgi_param PHP_AUTH_PW $http_authorization; } location ~ /db/ { diff --git a/pagos/add.html b/pagos/add.html index 0ab1a60..5311090 100644 --- a/pagos/add.html +++ b/pagos/add.html @@ -4,10 +4,9 @@