Dockerfile from hostuk (FrankenPHP 1-php8.5), stripped scorer binary. Supervisor config simplified for lthn.io (no horizon/reverb). Octane + Predis installed. docker-compose.yml with Traefik labels, host.docker.internal for daemon/wallet/LNS access, file cache. TODO: Fix view namespace resolution inside container (localhost doesn't match Lethean $domains). Need to add localhost to Lethean $domains or test with proper Host header. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
61 lines
1.9 KiB
Docker
61 lines
1.9 KiB
Docker
# Host Hub - FrankenPHP Production Dockerfile
|
|
#
|
|
# The host prepares the application (composer install, npm build).
|
|
# This Dockerfile only packages the runtime image.
|
|
FROM dunglas/frankenphp:1-php8.5-trixie
|
|
|
|
# Install PHP extensions
|
|
RUN install-php-extensions \
|
|
pcntl \
|
|
pdo_mysql \
|
|
redis \
|
|
gd \
|
|
intl \
|
|
zip \
|
|
opcache \
|
|
bcmath \
|
|
exif \
|
|
sockets
|
|
|
|
# Upgrade base image packages and install system packages
|
|
RUN apt-get update && apt-get upgrade -y \
|
|
&& apt-get install -y --no-install-recommends \
|
|
redis-server supervisor curl mariadb-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Configure PHP for production
|
|
COPY --chmod=644 utils/docker/config/octane.ini $PHP_INI_DIR/conf.d/octane.ini
|
|
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Copy pre-built application (vendor + node_modules/public built on host)
|
|
COPY --chown=www-data:www-data --chmod=755 . .
|
|
|
|
# Clear stale caches and fix permissions
|
|
RUN rm -rf bootstrap/cache/*.php \
|
|
storage/framework/cache/data/* \
|
|
storage/framework/sessions/* \
|
|
storage/framework/views/* \
|
|
&& chmod -R 777 storage bootstrap/cache
|
|
|
|
# Optimise autoloader + discover packages
|
|
RUN composer dump-autoload --optimize \
|
|
&& php artisan package:discover --ansi
|
|
|
|
# Runtime scripts
|
|
COPY --chmod=755 utils/scripts/redis-entrypoint.sh /usr/local/bin/redis-entrypoint.sh
|
|
COPY --chmod=755 utils/scripts/laravel-entrypoint.sh /usr/local/bin/laravel-entrypoint.sh
|
|
COPY --chmod=644 utils/docker/config/supervisord.prod.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
ENV OCTANE_PORT=80
|
|
EXPOSE 80 8080 8088 6379 26379
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD curl -f http://localhost:${OCTANE_PORT}/up || exit 1
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|