Files
michaelschiemer/docker/worker/Dockerfile
Michael Schiemer 36ef2a1e2c
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
fix: Gitea Traefik routing and connection pool optimization
- Remove middleware reference from Gitea Traefik labels (caused routing issues)
- Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s)
- Add explicit service reference in Traefik labels
- Fix intermittent 504 timeouts by improving PostgreSQL connection handling

Fixes Gitea unreachability via git.michaelschiemer.de
2025-11-09 14:46:15 +01:00

73 lines
2.0 KiB
Docker

ARG PHP_VERSION=8.5.0RC4
# Keep aligned with runtime PHP tag (override via --build-arg PHP_VERSION=X)
FROM php:${PHP_VERSION}-cli
# Install system dependencies including libraries for GD and other extensions
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
libicu-dev \
libpq-dev \
libsodium-dev \
zip \
unzip \
procps \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Configure GD extension with JPEG and FreeType support
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
# Install PHP extensions for worker functionality and web features
# Note: opcache and sodium are already built into PHP 8.5
RUN docker-php-ext-install -j$(nproc) \
pdo_mysql \
pdo_pgsql \
mbstring \
exif \
pcntl \
posix \
sockets \
shmop \
gd \
zip \
intl \
bcmath
# Install PECL extensions (Redis for queue system)
RUN pecl install redis-6.3.0RC1 apcu \
&& docker-php-ext-enable redis apcu
# Configure APCu
RUN echo "apc.enable_cli=1" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \
&& echo "apc.shm_size=128M" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Create storage directory structure for volume mounts
RUN mkdir -p /var/www/html/storage/cache \
/var/www/html/storage/queue \
/var/www/html/storage/discovery \
/var/www/html/storage/logs \
/var/www/html/var
# Note: Application files and dependencies will be available via mounted volume
# No need to copy files during build since we'll use the mounted project directory
# Health check for the worker
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD ps aux | grep -v grep | grep "worker.php" || exit 1
# Run worker directly since permissions are handled by docker-compose user directive
CMD ["php", "/var/www/html/worker.php"]