fix: worker logs permission denied + migration AFTER password
This commit is contained in:
+6
-2
@@ -7,6 +7,7 @@ ENV TZ=America/Bogota
|
|||||||
# Instalar dependencias
|
# Instalar dependencias
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
|
su-exec \
|
||||||
libzip \
|
libzip \
|
||||||
libzip-dev \
|
libzip-dev \
|
||||||
icu \
|
icu \
|
||||||
@@ -59,10 +60,13 @@ RUN if [ -f composer.json ]; then \
|
|||||||
# Dar permisos
|
# Dar permisos
|
||||||
RUN chmod +x worker.php
|
RUN chmod +x worker.php
|
||||||
|
|
||||||
|
# Entrypoint: arregla permisos del volumen montado y ejecuta como www
|
||||||
|
COPY docker/worker-entrypoint.sh /usr/local/bin/worker-entrypoint.sh
|
||||||
|
RUN chmod +x /usr/local/bin/worker-entrypoint.sh
|
||||||
|
|
||||||
# Health check
|
# Health check
|
||||||
HEALTHCHECK --interval=60s --timeout=5s --start-period=30s --retries=3 \
|
HEALTHCHECK --interval=60s --timeout=5s --start-period=30s --retries=3 \
|
||||||
CMD pgrep -f "worker.php" || exit 1
|
CMD pgrep -f "worker.php" || exit 1
|
||||||
|
|
||||||
USER www
|
ENTRYPOINT ["/usr/local/bin/worker-entrypoint.sh"]
|
||||||
|
|
||||||
CMD ["php", "worker.php", "--daemon"]
|
CMD ["php", "worker.php", "--daemon"]
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ CREATE TABLE IF NOT EXISTS `lab_config` (
|
|||||||
-- C1) COLUMNA: admin_users.role_id (prod → local / instalaciones nuevas)
|
-- C1) COLUMNA: admin_users.role_id (prod → local / instalaciones nuevas)
|
||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
ALTER TABLE `admin_users`
|
ALTER TABLE `admin_users`
|
||||||
ADD COLUMN IF NOT EXISTS `role_id` int(11) DEFAULT NULL AFTER `password`;
|
ADD COLUMN IF NOT EXISTS `role_id` int(11) DEFAULT NULL;
|
||||||
|
|
||||||
-- C1a) FK opcional: se añade solo si no existe ya
|
-- C1a) FK opcional: se añade solo si no existe ya
|
||||||
-- (MariaDB/MySQL 10.x: ADD CONSTRAINT IF NOT EXISTS no es estándar,
|
-- (MariaDB/MySQL 10.x: ADD CONSTRAINT IF NOT EXISTS no es estándar,
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Entrypoint del worker: arregla permisos del volumen montado y ejecuta como www
|
||||||
|
|
||||||
|
mkdir -p /var/www/html/logs /var/www/html/uploads
|
||||||
|
chown -R www:www /var/www/html/logs /var/www/html/uploads
|
||||||
|
chmod -R 775 /var/www/html/logs /var/www/html/uploads
|
||||||
|
|
||||||
|
exec su-exec www "$@"
|
||||||
Reference in New Issue
Block a user