Docker: agregar setup local con NGINX + PHP-FPM y script de control

Incluye Dockerfile, docker-compose.yml (puerto 8088), nginx.conf y
script _app con --status, --start y --stop para levantar la app localmente.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ricardo Monla
2026-06-03 15:58:27 -03:00
co-authored by Claude Sonnet 4.6
parent cdbbf0e6db
commit 5a54fdcfde
4 changed files with 98 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
FROM php:8.2-fpm-alpine
RUN apk add --no-cache sqlite sqlite-dev \
&& docker-php-ext-install pdo pdo_sqlite
WORKDIR /var/www/html
Executable
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
URL="http://srv-ns8:8088"
status() {
APP=$(docker compose -f "$DIR/docker-compose.yml" ps --status running --quiet app 2>/dev/null)
WEB=$(docker compose -f "$DIR/docker-compose.yml" ps --status running --quiet web 2>/dev/null)
if [[ -n "$APP" && -n "$WEB" ]]; then
echo "✔ rm-PAGOs está corriendo → $URL"
elif [[ -z "$APP" && -z "$WEB" ]]; then
echo "✘ rm-PAGOs está detenida."
echo ""
echo " Para levantar:"
echo " cd $DIR && docker compose up -d"
echo " o simplemente:"
echo " $0 --start"
else
echo "⚠ Estado parcial (un contenedor está caído)."
docker compose -f "$DIR/docker-compose.yml" ps
echo ""
echo " Para reiniciar:"
echo " $0 --start"
fi
}
case "$1" in
--status) status ;;
--start)
echo "Levantando rm-PAGOs..."
docker compose -f "$DIR/docker-compose.yml" up -d
echo "Listo → $URL"
;;
--stop)
echo "Bajando rm-PAGOs..."
docker compose -f "$DIR/docker-compose.yml" down
;;
*)
echo "Uso: $0 --status | --start | --stop"
;;
esac
+27
View File
@@ -0,0 +1,27 @@
services:
app:
build: .
volumes:
- ./pagos:/var/www/html
- db_data:/var/www/html/db
networks:
- pagos_net
web:
image: nginx:alpine
ports:
- "8088:80"
volumes:
- ./pagos:/var/www/html
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
- db_data:/var/www/html/db
depends_on:
- app
networks:
- pagos_net
volumes:
db_data:
networks:
pagos_net:
+23
View File
@@ -0,0 +1,23 @@
server {
listen 80;
root /var/www/html;
index index.html index.php;
resolver 127.0.0.11 valid=10s;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
set $upstream app:9000;
fastcgi_pass $upstream;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /db/ {
deny all;
}
}