➜ ✗ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2a1c82215adc hivelo-cloud-realtime-api-app "docker-php-entrypoi…" About a minute ago Up About a minute (healthy) 443/tcp, 2019/tcp, 443/udp, 0.0.0.0:8080->80/tcp laravel-app
0152bb5f5293 redis:alpine "docker-entrypoint.s…" About a minute ago Up About a minute 0.0.0.0:6379->6379/tcp laravel-redis
786b6e799d18 mysql:8 "docker-entrypoint.s…" About a minute ago Up About a minute 33060/tcp, 0.0.0.0:3307->3306/tcp laravel-mysql
➜ ✗ curl -v http://localhost:8080/health
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
* Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /health HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 308 Permanent Redirect
< Connection: close
< Location: https://localhost/health
< Server: Caddy
< Date: Wed, 25 Jun 2025 17:33:58 GMT
< Content-Length: 0
<
* Closing connection
➜ ✗ docker logs
➜ ✗ docker logs laravel-app
{"level":"info","ts":1750872665.676556,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
{"level":"warn","ts":1750872665.68082,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":16}
{"level":"info","ts":1750872665.6827374,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//127.0.0.1:2019","//localhost:2019","//[::1]:2019"]}
{"level":"info","ts":1750872665.6830971,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
{"level":"info","ts":1750872665.6831121,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1750872665.6848764,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000575f00"}
{"level":"info","ts":1750872665.7003472,"logger":"tls","msg":"cleaning storage unit","storage":"FileStorage:/data/caddy"}
{"level":"info","ts":1750872665.701009,"logger":"tls","msg":"finished cleaning storage units"}
{"level":"warn","ts":1750872665.7419686,"logger":"pki.ca.local","msg":"installing root certificate (you might be prompted for password)","path":"storage:pki/authorities/local/root.crt"}
{"level":"info","ts":1750872665.7468567,"msg":"warning: \"certutil\" is not available, install \"certutil\" with \"apt install libnss3-tools\" or \"yum install nss-tools\" and try again"}
{"level":"info","ts":1750872665.7469351,"msg":"define JAVA_HOME environment variable to use the Java trust"}
{"level":"info","ts":1750872666.8530083,"msg":"certificate installed properly in linux trusts"}
{"level":"info","ts":1750872666.8532894,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
{"level":"info","ts":1750872666.8534482,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."}
{"level":"info","ts":1750872666.8535628,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"info","ts":1750872666.8536122,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
{"level":"info","ts":1750872666.8536463,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["localhost"]}
{"level":"info","ts":1750872666.8538082,"msg":"FrankenPHP started 🐘","php_version":"8.3.4"}
{"level":"info","ts":1750872666.8542845,"logger":"tls.obtain","msg":"acquiring lock","identifier":"localhost"}
{"level":"info","ts":1750872666.8562028,"logger":"tls.obtain","msg":"lock acquired","identifier":"localhost"}
{"level":"info","ts":1750872666.856318,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"localhost"}
{"level":"info","ts":1750872666.8572423,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
{"level":"info","ts":1750872666.857284,"msg":"serving initial configuration"}
{"level":"info","ts":1750872666.8580806,"logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"localhost"}
{"level":"info","ts":1750872666.8581731,"logger":"tls.obtain","msg":"releasing lock","identifier":"localhost"}
{"level":"warn","ts":1750872666.8584404,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [localhost]: no OCSP server specified in certificate","identifiers":["localhost"]}
➜ ✗
I’ve faced like this.
FROM dunglas/frankenphp:1.1.0
# Set working directory
WORKDIR /app
# Copy Laravel app
COPY ./src /app
# Copy Caddyfile
COPY ./Caddyfile /etc/frankenphp/Caddyfile
# Set permissions
RUN chown -R www-data:www-data /app && chmod -R 755 /app
RUN set -xe \
&& apt-get update && apt-get install -y \
git \
unzip \
curl \
libpng-dev \
libzip-dev \
libonig-dev \
libxml2-dev \
zlib1g-dev \
libcurl4-openssl-dev \
libpq-dev \
libsqlite3-dev \
default-mysql-client \
&& docker-php-ext-install \
pdo \
pdo_mysql \
mbstring \
zip \
bcmath \
opcache \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer config --global --auth github-oauth.github.com ghp_xxx
RUN composer install -v --ignore-platform-reqs
# Laravel setup commands
RUN php artisan config:clear \
&& php artisan route:clear \
&& php artisan view:clear
# Expose the port (FrankenPHP uses 80 by default)
EXPOSE 80
This is dockerfile-php
version: "3.8"
services:
app:
build:
context: .
dockerfile: dockerfile-php
container_name: laravel-app
ports:
- "8080:80"
volumes:
- ./src:/app
- ./Caddyfile:/etc/frankenphp/Caddyfile:ro # Mount the Caddyfile for FrankenPHP
environment:
APP_ENV: local
APP_DEBUG: true
APP_KEY: base64:DeB4Unpg4W8oe3uDiBvPRB6lN4Fla91t1ShUuzikLdE=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: realtime
DB_USERNAME: realtime
DB_PASSWORD: realtime
REDIS_HOST: redis
db:
image: mysql:8
container_name: laravel-mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: realtime
MYSQL_USER: realtime
MYSQL_PASSWORD: realtime
volumes:
- dbdata:/var/lib/mysql
ports:
- "3307:3306"
redis:
image: redis:alpine
container_name: laravel-redis
ports:
- "6379:6379"
volumes:
dbdata:
this is docker-compose.yml
Route::get('/health', function () {
return response()->json(['status' => 'OK']);
});
I’ve defined a route in web.php
{
auto_https off
}
:80 {
root * /app/public
encode gzip
php_fastcgi unix//var/run/frankenphp.sock
rewrite /index.php{uri}
rewrite * /index.php
file_server
log {
output stdout
format console
level DEBUG
}
}
This is Caddyfile
hivelo-cloud-realtime-api git:(master) ✗ docker exec -it laravel-app cat /etc/caddy/Caddyfile
{
{$CADDY_GLOBAL_OPTIONS}
frankenphp {
#worker /path/to/your/worker.php
{$FRANKENPHP_CONFIG}
}
# https://caddyserver.com/docs/caddyfile/directives#sorting-algorithm
order mercure after encode
order vulcain after reverse_proxy
order php_server before file_server
order php before file_server
}
{$CADDY_EXTRA_CONFIG}
{$SERVER_NAME:localhost} {
#log {
# # Redact the authorization query parameter that can be set by Mercure
# format filter {
# wrap console
# fields {
# uri query {
# replace authorization REDACTED
# }
# }
# }
#}
root * public/
encode zstd br gzip
# Uncomment the following lines to enable Mercure and Vulcain modules
#mercure {
# # Transport to use (default to Bolt)
# transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db}
# # Publisher JWT key
# publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
# # Subscriber JWT key
# subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
# # Allow anonymous subscribers (double-check that it's what you want)
# anonymous
# # Enable the subscription API (double-check that it's what you want)
# subscriptions
# # Extra directives
# {$MERCURE_EXTRA_DIRECTIVES}
#}
#vulcain
{$CADDY_SERVER_EXTRA_DIRECTIVES}
php_server
}
this is docker exec -it laravel-app cat /etc/caddy/Caddyfile
Can you please check and provide any suggestions step by step how to trace?
Thanks you!