Replies: 1 comment
-
|
You have to set the port to serve on, ie: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
Hey guys. I tried to deploy my Laravel app into the docker container with Franken and it doesnt work.
Background:
I got docker composed services runing on one machine - each service is separate compose project connected with same local docker network - that is preparation for the Kubernetes in long term. Ther is a need to serve multiple services on the same domain name so we decided to use KongAPI in front and split traffic when needed. That is why I need to have only http port enabled. I do not want for now to complicate communicaton with https communication between kong and services - it will happen maybe in some distant future. So the requirements are:
And I failed. Help help please
When I start docker and try to wget I got:
`wget http://DOMAIN_NAME:8000
--2024-07-24 05:19:34-- http://DOMAIN_NAME:8000/
Resolving DOMAIN_NAME (DOMAIN_NAME)... 127.0.1.1
Connecting to DOMAIN_NAME (DOMAIN_NAME)|127.0.1.1|:8000... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.
--2024-07-24 05:19:35-- (try: 2) http://DOMAIN_NAME:8000/
Connecting to DOMAIN_NAME (DOMAIN_NAME)|127.0.1.1|:8000... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.
--2024-07-24 05:19:37-- (try: 3) http://DOMAIN_NAME:8000/
Connecting to DOMAIN_NAME (DOMAIN_NAME)|127.0.1.1|:8000... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.
`
Logs from franken
docker logs emotivo.pim.product 2024/07/23 11:48:24.614 INFO using config from file {"file": "/etc/caddy/Caddyfile"} 2024/07/23 11:48:24.616 INFO adapted config to JSON {"adapter": "caddyfile"} 2024/07/23 11:48:24.616 WARN Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies {"adapter": "caddyfile", "file": "/etc/caddy/Caddyfile", "line": 2} 2024/07/23 11:48:24.617 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//[::1]:2019", "//127.0.0.1:2019", "//localhost:2019"]} 2024/07/23 11:48:24.617 INFO http.auto_https automatic HTTPS is completely disabled for server {"server_name": "srv0"} 2024/07/23 11:48:24.618 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc0003a9b80"} 2024/07/23 11:48:24.618 INFO FrankenPHP started 🐘 {"php_version": "8.3.9", "num_threads": 4} 2024/07/23 11:48:24.618 INFO http enabling HTTP/3 listener {"addr": ":443"} 2024/07/23 11:48:24.619 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]} 2024/07/23 11:48:24.619 INFO autosaved config (load with --resume flag){"file": "/config/caddy/autosave.json"} 2024/07/23 11:48:24.619 INFO serving initial configuration 2024/07/23 11:48:24.621 INFO tls cleaning storage unit {"storage": "FileStorage:/data/caddy"} 2024/07/23 11:48:24.621 INFO tls finished cleaning storage unitsCaddyfile
`{
{$CADDY_GLOBAL_OPTIONS}
auto_https off
http_port 8000
frankenphp {
#worker /path/to/your/worker.php
{$FRANKENPHP_CONFIG}
}
}
{$CADDY_EXTRA_CONFIG}
{$SERVER_NAME:localhost} {
#log {
# # Redact the authorization query parameter that can be set by Mercure
# format filter {
# request>uri query {
# replace authorization REDACTED
# }
# }
#}
}
`
docker compose file
`services:
app.name:
image: registry.gitlab.com/company.name/app.name:test
container_name: app.name
hostname: app.name
stdin_open: true
tty: true
restart: always
privileged: true
ports:
- "8000:8000"
- "8443:8443"
- "8443:8443/udp"
environment:
- SERVER_NAME=DOMAIN_NAME
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
networks:
- new_arch_stack-local
networks:
new_arch_stack-local:
external: true`
Docker file
`FROM dunglas/frankenphp
COPY . /app`
Build Type
Docker (Debian Bookworm)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
Relevant log output
No response
Beta Was this translation helpful? Give feedback.
All reactions