diff --git a/compose.yml b/compose.yml index 742bf69..e697297 100644 --- a/compose.yml +++ b/compose.yml @@ -10,7 +10,7 @@ services: hydra-sql: build: context: . - dockerfile: ./misc/images/hydra-sql-dev/Dockerfile + dockerfile: ./misc/images/hydra-sql-standalone/Dockerfile args: - SERVER_NAME=http://localhost:10500 links: @@ -21,7 +21,7 @@ services: develop: watch: - action: rebuild - path: ./misc/images/hydra-sql-dev + path: ./misc/images/hydra-sql-standalone - action: rebuild path: ./misc/files - action: rebuild @@ -70,8 +70,8 @@ services: hydra: condition: service_healthy network_mode: host - restart: unless-stopped + hydra: image: cadoles/hydra-v1:v0.0.0-151-gc9c6fb1 volumes: diff --git a/composer.json b/composer.json index 3327913..babc1c2 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,6 @@ "ext-iconv": "*", "runtime/frankenphp-symfony": "^0.2.0", "sentry/sentry-symfony": "^5", - "symfony/apache-pack": "^1.0", "symfony/asset": "6.4.*", "symfony/console": "6.4.*", "symfony/dependency-injection": "6.4.*", diff --git a/misc/files/Caddyfile b/misc/files/Caddyfile index 8c9a8c4..4280cda 100644 --- a/misc/files/Caddyfile +++ b/misc/files/Caddyfile @@ -1,43 +1,30 @@ -# The Caddyfile is an easy way to configure FrankenPHP and the Caddy web server. -# -# https://frankenphp.dev/docs/config -# https://caddyserver.com/docs/caddyfile - { skip_install_trust auto_https off admin off persist_config off - - {$CADDY_GLOBAL_OPTIONS} + storage file_system {$CADDY_DATA_FS:/tmp/caddy} frankenphp { - php_ini { - realpath_cache_size 4096K - realpath_cache_ttl 600 - opcache.enable_cli 1 - opcache.memory_consumption 512 - opcache.max_accelerated_files 20000 - opcache.preload /app/config/preload.php - opcache.preload_user www-data - apc.enable_cli 1 - apc.enable 1 + php_ini "apc.enable_cli" "{$CADDY_APC_ENABLE_CLI:1}" + php_ini "apc.enable" "{$CADDY_APC_ENABLE:1}" + php_ini "display_errors" "{$CADDY_DISPLAY_ERRORS:Off}" + php_ini "display_startup_errors" "{$CADDY_DISPLAY_STARTUP_ERRORS:Off}" + php_ini "zend.assertions" "{$CADDY_ZEND_ASSERTIONS:-1}" - {$PHPINI_EXTRA_CONFIG} - } - worker { - file /app/public/index.php - watch - name hydra-sql-worker - {$FRANKENPHP_WORKER_CONFIG} - } - {$FRANKENPHP_CONFIG} + worker { + file /app/public/index.php + name hydra-oidc-worker + {$WORKER_EXTRA_CONFIG} + } } + + {$CADDY_GLOBAL_OPTIONS} } {$CADDY_EXTRA_CONFIG} -{$SERVER_NAME:localhost} { +{$SERVER_NAME:}:{$CADDY_HTTP_PORT:8080} { root {$SERVER_ROOT:public/} encode zstd br gzip diff --git a/misc/files/frankenphp.caddyfile-prod b/misc/files/frankenphp.caddyfile-prod deleted file mode 100644 index 1ef2a15..0000000 --- a/misc/files/frankenphp.caddyfile-prod +++ /dev/null @@ -1,8 +0,0 @@ -{ - frankenphp { - php_ini { - opcache.validate_timestamps 0 - opcache.revalidate_freq 0 - } - } -} \ No newline at end of file diff --git a/misc/images/hydra-sql-prod/Dockerfile b/misc/images/hydra-sql-base/Dockerfile similarity index 92% rename from misc/images/hydra-sql-prod/Dockerfile rename to misc/images/hydra-sql-base/Dockerfile index e7333f2..c1a0381 100644 --- a/misc/images/hydra-sql-prod/Dockerfile +++ b/misc/images/hydra-sql-base/Dockerfile @@ -48,16 +48,18 @@ ENV APP_ENV=prod \ VERSION=${VERSION} COPY ./misc/files/Caddyfile /etc/frankenphp/Caddyfile -COPY ./misc/files/frankenphp.caddyfile-prod /etc/frankenphp/Caddyfile.d/frankenphp.caddyfile WORKDIR /app COPY --from=composer-install /app . +RUN mkdir -p /tmp/caddy && chown -R 1000:1000 /tmp/caddy + RUN cp $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini \ && install-php-extensions \ pdo_pgsql \ pdo_mysql \ opcache \ apcu \ - redis \ No newline at end of file + intl \ + redis diff --git a/misc/images/hydra-sql-dev/Dockerfile b/misc/images/hydra-sql-standalone/Dockerfile similarity index 100% rename from misc/images/hydra-sql-dev/Dockerfile rename to misc/images/hydra-sql-standalone/Dockerfile