Skip to content

Commit d8ab384

Browse files
committed
chore(docker): update image configuration, docs and nginx setup
- added `DOCKER_HUB.md`, `IMAGE_USAGE_GUIDE.md`, and `TESTING.md` for publishing, usage and testing guidance - updated `Dockerfile`, `Makefile`, and `docker-entrypoint.sh` for improved container workflow - updated `README.md` with revised instructions - removed outdated `USAGE_GUIDE.md` - added `index.php` as application entry point - refined `health.php` implementation - updated Nginx configs (`default.conf`, `nginx.conf`) - updated script `process-configs.sh` for config handling
1 parent 82c29a5 commit d8ab384

13 files changed

Lines changed: 3908 additions & 1635 deletions

DOCKER_HUB.md

Lines changed: 713 additions & 0 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -362,24 +362,32 @@ RUN set -eux; \
362362
# Build argument para decidir qual health check usar
363363
ARG HEALTH_CHECK_TYPE=simple
364364

365-
# Copy comprehensive health check se especificado
366-
COPY --chown=nginx:nginx health.php /tmp/health-comprehensive.php
367-
368-
# Instalar health check apropriado
369-
RUN if [ "$HEALTH_CHECK_TYPE" = "comprehensive" ]; then \
370-
echo "==> Installing comprehensive health check..."; \
371-
cp /tmp/health-comprehensive.php /var/www/html/public/health.php; \
372-
php -l /var/www/html/public/health.php; \
365+
# Copy demo index.php and health check templates to shared directory
366+
# ============================================================================
367+
# TEMPLATES AND DEMO FILES
368+
# ============================================================================
369+
370+
# Create templates directory
371+
RUN mkdir -p /usr/local/share/php-api-stack
372+
373+
# Copy demo index.php and health check templates
374+
COPY --chown=nginx:nginx index.php /usr/local/share/php-api-stack/index.php
375+
COPY --chown=nginx:nginx health.php /usr/local/share/php-api-stack/health-comprehensive.php
376+
377+
# Install appropriate health check template based on build type
378+
RUN set -eux; \
379+
if [ "$HEALTH_CHECK_TYPE" = "comprehensive" ]; then \
380+
echo "==> Installing comprehensive health check template..."; \
381+
cp /usr/local/share/php-api-stack/health-comprehensive.php /usr/local/share/php-api-stack/health.php; \
382+
php -l /usr/local/share/php-api-stack/health.php; \
373383
else \
374-
echo "==> Installing simple health check..."; \
375-
printf '<?php\n' > /var/www/html/public/health.php; \
376-
printf 'header("Content-Type: application/json");\n' >> /var/www/html/public/health.php; \
377-
printf 'echo json_encode(["status"=>"healthy","timestamp"=>date("c")]);\n' >> /var/www/html/public/health.php; \
384+
echo "==> Installing simple health check template..."; \
385+
printf '<?php\n' > /usr/local/share/php-api-stack/health.php; \
386+
printf 'header("Content-Type: application/json");\n' >> /usr/local/share/php-api-stack/health.php; \
387+
printf 'echo json_encode(["status"=>"healthy","timestamp"=>date("c")]);\n' >> /usr/local/share/php-api-stack/health.php; \
378388
fi && \
379-
chown nginx:nginx /var/www/html/public/health.php && \
380-
chmod 644 /var/www/html/public/health.php && \
381-
rm -f /tmp/health-comprehensive.php && \
382-
echo " [✓] Health check installed successfully"
389+
php -l /usr/local/share/php-api-stack/index.php && \
390+
echo " [✓] Templates validated and ready"
383391

384392
# Health check
385393
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \

0 commit comments

Comments
 (0)