Simplify: remove custom entrypoint, use Coolify post-deploy instead
This commit is contained in:
-32
@@ -11,36 +11,4 @@ COPY custom/ /var/www/html/custom/
|
||||
# Ensure correct permissions
|
||||
RUN chown -R www-data:www-data /var/www/html/custom
|
||||
|
||||
# Post-deploy: clear cache and rebuild on startup
|
||||
COPY --chmod=755 <<'EOF' /usr/local/bin/post-deploy.sh
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Wait for the original entrypoint to finish setup
|
||||
sleep 5
|
||||
|
||||
# Clear cache so EspoCRM picks up new/changed extensions
|
||||
if [ -d "/var/www/html/data/cache" ]; then
|
||||
rm -rf /var/www/html/data/cache/*
|
||||
echo "Cache cleared."
|
||||
fi
|
||||
|
||||
# Run rebuild if config exists (means EspoCRM is installed)
|
||||
if [ -f "/var/www/html/data/config.php" ]; then
|
||||
cd /var/www/html
|
||||
php rebuild.php
|
||||
echo "Rebuild complete."
|
||||
fi
|
||||
EOF
|
||||
|
||||
# Wrap the original entrypoint to run post-deploy after startup
|
||||
COPY --chmod=755 <<'EOF' /usr/local/bin/dev-entrypoint.sh
|
||||
#!/bin/bash
|
||||
# Run post-deploy in background after container starts
|
||||
(post-deploy.sh &)
|
||||
# Execute original entrypoint
|
||||
exec docker-entrypoint.sh apache2-foreground
|
||||
EOF
|
||||
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["dev-entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user