Skip to content

Commit ab22016

Browse files
committed
move Caddyfile to /etc/frankenphp/Caddyfile
1 parent 4dc870f commit ab22016

9 files changed

Lines changed: 24 additions & 18 deletions

File tree

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ RUN set -eux; \
1919
/app/public \
2020
/config/caddy \
2121
/data/caddy \
22-
/etc/caddy; \
22+
/etc/frankenphp; \
2323
sed -i 's/php/frankenphp run/g' /usr/local/bin/docker-php-entrypoint; \
2424
echo '<?php phpinfo();' > /app/public/index.php
2525

26-
COPY --link caddy/frankenphp/Caddyfile /etc/caddy/Caddyfile
26+
COPY --link caddy/frankenphp/Caddyfile /etc/frankenphp/Caddyfile
2727
RUN curl -sSLf \
2828
-o /usr/local/bin/install-php-extensions \
2929
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
3030
chmod +x /usr/local/bin/install-php-extensions
3131

32-
CMD ["--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
32+
CMD ["--config", "/etc/frankenphp/Caddyfile", "--adapter", "caddyfile"]
3333
HEALTHCHECK CMD curl -f http://localhost:2019/metrics || exit 1
3434

3535
# See https://caddyserver.com/docs/conventions#file-locations for details
@@ -112,7 +112,7 @@ RUN echo $CGO_LDFLAGS
112112
WORKDIR /go/src/app/caddy/frankenphp
113113
RUN GOBIN=/usr/local/bin go install -tags 'nobadger,nomysql,nopgx' -ldflags "-w -s -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy'" -buildvcs=true && \
114114
setcap cap_net_bind_service=+ep /usr/local/bin/frankenphp && \
115-
cp Caddyfile /etc/caddy/Caddyfile && \
115+
cp Caddyfile /etc/frankenphp/Caddyfile && \
116116
frankenphp version && \
117117
frankenphp build-info
118118

alpine.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ RUN set -eux; \
1818
/app/public \
1919
/config/caddy \
2020
/data/caddy \
21-
/etc/caddy; \
21+
/etc/frankenphp; \
2222
sed -i 's/php/frankenphp run/g' /usr/local/bin/docker-php-entrypoint; \
2323
echo '<?php phpinfo();' > /app/public/index.php
2424

25-
COPY --link caddy/frankenphp/Caddyfile /etc/caddy/Caddyfile
25+
COPY --link caddy/frankenphp/Caddyfile /etc/frankenphp/Caddyfile
2626
RUN curl -sSLf \
2727
-o /usr/local/bin/install-php-extensions \
2828
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
2929
chmod +x /usr/local/bin/install-php-extensions
3030

31-
CMD ["--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
31+
CMD ["--config", "/etc/frankenphp/Caddyfile", "--adapter", "caddyfile"]
3232
HEALTHCHECK CMD curl -f http://localhost:2019/metrics || exit 1
3333

3434
# See https://caddyserver.com/docs/conventions#file-locations for details

dev-alpine.Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@ RUN git clone --branch=PHP-8.4 https://github.com/php/php-src.git . && \
5555
--enable-zts \
5656
--disable-zend-signals \
5757
--enable-zend-max-execution-timers \
58+
--with-config-file-path=/etc/frankenphp/php.ini \
59+
--with-config-file-scan-dir=/etc/frankenphp/php.d \
5860
--enable-debug && \
5961
make -j"$(nproc)" && \
6062
make install && \
6163
ldconfig /etc/ld.so.conf.d && \
62-
cp php.ini-development /usr/local/lib/php.ini && \
63-
echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
64-
echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
64+
mkdir -p /etc/frankenphp/php.d && \
65+
cp php.ini-development /etc/frankenphp/php.ini && \
66+
echo "zend_extension=opcache.so" >> /etc/frankenphp/php.ini && \
67+
echo "opcache.enable=1" >> /etcfrankenphp/php.ini && \
6568
php --version
6669

6770
# Install e-dant/watcher (necessary for file watching)

dev.Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,16 @@ RUN git clone --branch=PHP-8.4 https://github.com/php/php-src.git . && \
5757
--enable-zts \
5858
--disable-zend-signals \
5959
--enable-zend-max-execution-timers \
60+
--with-config-file-path=/etc/frankenphp/php.ini \
61+
--with-config-file-scan-dir=/etc/frankenphp/php.d \
6062
--enable-debug && \
6163
make -j"$(nproc)" && \
6264
make install && \
6365
ldconfig && \
64-
cp php.ini-development /usr/local/lib/php.ini && \
65-
echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
66-
echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
66+
mkdir -p /etc/frankenphp/php.d && \
67+
cp php.ini-development /etc/frankenphp/php.ini && \
68+
echo "zend_extension=opcache.so" >> /etc/frankenphp/php.ini && \
69+
echo "opcache.enable=1" >> /etcfrankenphp/php.ini && \
6770
php --version
6871

6972
# Install e-dant/watcher (necessary for file watching)

docs/cn/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FrankenPHP,Caddy 以及 Mercure 和 Vulcain 模块可以使用 [Caddy 支持的格式](https://caddyserver.com/docs/getting-started#your-first-config) 进行配置。
44

5-
[Docker 映像](docker.md) 中,`Caddyfile` 位于 `/etc/caddy/Caddyfile`
5+
[Docker 映像](docker.md) 中,`Caddyfile` 位于 `/etc/frankenphp/Caddyfile`
66
静态二进制文件会在启动时所在的目录中查找 `Caddyfile`
77
PHP 本身可以[使用 `php.ini` 文件](https://www.php.net/manual/zh/configuration.file.php)进行配置。
88
默认情况下,随 Docker 映像提供的 PHP 和静态二进制文件中包含的 PHP 将在启动 FrankenPHP 的目录和 `/usr/local/etc/php/` 中查找`php.ini` 文件。它们还会从 `/usr/local/etc/php/conf.d/` 中加载所有以 `.ini` 结尾的文件。

docs/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FrankenPHP, Caddy as well as the Mercure and Vulcain modules can be configured using [the formats supported by Caddy](https://caddyserver.com/docs/getting-started#your-first-config).
44

5-
In [the Docker images](docker.md), the `Caddyfile` is located at `/etc/caddy/Caddyfile`.
5+
In [the Docker images](docker.md), the `Caddyfile` is located at `/etc/frankenphp/Caddyfile`.
66
The static binary will look for the `Caddyfile` in the directory in which it is started.
77

88
PHP itself can be configured [using a `php.ini` file](https://www.php.net/manual/en/configuration.file.php).

docs/fr/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FrankenPHP, Caddy ainsi que les modules Mercure et Vulcain peuvent être configurés en utilisant [les formats pris en charge par Caddy](https://caddyserver.com/docs/getting-started#your-first-config).
44

5-
Dans [les images Docker](docker.md), le `Caddyfile` est situé dans `/etc/caddy/Caddyfile`.
5+
Dans [les images Docker](docker.md), le `Caddyfile` est situé dans `/etc/frankenphp/Caddyfile`.
66
Le binaire statique cherchera le `Caddyfile` dans le répertoire dans lequel il est démarré.
77

88
PHP lui-même peut être configuré [en utilisant un fichier `php.ini`](https://www.php.net/manual/fr/configuration.file.php).

docs/ru/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FrankenPHP, Caddy, а также модули Mercure и Vulcain могут быть настроены с использованием [конфигурационных форматов, поддерживаемых Caddy](https://caddyserver.com/docs/getting-started#your-first-config).
44

5-
В [Docker-образах](docker.md) файл `Caddyfile` находится по пути `/etc/caddy/Caddyfile`.
5+
В [Docker-образах](docker.md) файл `Caddyfile` находится по пути `/etc/frankenphp/Caddyfile`.
66
Статический бинарный файл будет искать `Caddyfile` в директории запуска.
77

88
PHP можно настроить [с помощью файла `php.ini`](https://www.php.net/manual/en/configuration.file.php).

docs/tr/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FrankenPHP, Caddy'nin yanı sıra Mercure ve Vulcain modülleri [Caddy tarafından desteklenen formatlar](https://caddyserver.com/docs/getting-started#your-first-config) kullanılarak yapılandırılabilir.
44

5-
Docker imajlarında] (docker.md), `Caddyfile` `/etc/caddy/Caddyfile` adresinde bulunur.
5+
Docker imajlarında] (docker.md), `Caddyfile` `/etc/frankenphp/Caddyfile` adresinde bulunur.
66
Statik ikili, başlatıldığı dizinde `Caddyfile` dosyasını arayacaktır.
77

88
PHP'nin kendisi [bir `php.ini` dosyası kullanılarak yapılandırılabilir](https://www.php.net/manual/tr/configuration.file.php).

0 commit comments

Comments
 (0)