admin管理员组文章数量:1122846
I recently updated ddev from v1.21.0
to v1.23.5
.
My configuration contains several services, but uses NOT the web
container itself, because there is not "default" service. I us ddev-router to route the traffic to the specific ports of each container, depending pn the fqdns.
After the update and fixing some issues, ALL traffic is routed to web
and no service is addressed properly anymore.
These are parts of my config (this is an older project, so please do not complain about the php version):
config.yaml
name: kla-api
type: php
docroot: public
php_version: "7.4"
webserver_type: apache-fpm
xdebug_enabled: true
additional_hostnames: []
additional_fqdns:
- kla-backend.ddev.site
- kla-frontend.ddev.site
- kla-mail-service.ddev.site
- kla-file-service.ddev.site
- kla-preview-service.ddev.site
- kla-configuration-service.ddev.site
- kla-api.ddev.site
- dba
database:
type: mariadb
version: "10.4"
use_dns_when_possible: true
composer_version: "2"
web_environment: []
nodejs_version: "16"
corepack_enable: false
docker-compose.api-service.yaml (as a sample)
services:
kla-api.ddev.site:
container_name: "kla-api"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: ${DDEV_APPROOT}
com.ddev.app-type: php
build:
args:
BASE_IMAGE: ddev/ddev-webserver:v1.23.5
DDEV_PHP_VERSION: "7.4"
gid: "20"
uid: "1025"
username: fwtag
context: [xxx]/kla-api/.ddev/.webimageBuild
dockerfile: Dockerfile
external_links:
- ddev-router:kla-api.ddev.site
cap_add:
- SYS_PTRACE
healthcheck:
interval: 1s
retries: 120
start_period: 2m0s
timeout: 2m0s
networks:
ddev_default: null
default: null
expose:
- 8040
- 8041
environment:
PHP_IDE_CONFIG: serverName=kla-api.ddev.site
VIRTUAL_HOST: kla-api.ddev.site
DDEV_PRIMARY_URL:
HTTP_EXPOSE: 80:80,8040:8040
HTTPS_EXPOSE: 443:80,8041:8040
DDEV_WEBSERVER_TYPE: apache-fpm
DDEV_XDEBUG_ENABLED: "true"
DDEV_DOCROOT: public
DOCROOT: public
DDEV_PHP_VERSION: "7.4"
SSH_AUTH_SOCK: /home/.ssh-agent/socket
USER: fwtag
links:
- db:db
restart: "no"
user: "1025:20"
volumes:
- bind:
create_host_path: true
read_only: true
source: [xxx]/kla-api/.ddev
target: /mnt/ddev_config
type: bind
- source: [xxx]/kla-api
target: /var/www/html
type: bind
- source: ddev-global-cache
target: /mnt/ddev-global-cache
type: volume
volume: { }
- source: ddev-ssh-agent_socket_dir
target: /home/.ssh-agent
type: volume
volume: { }
working_dir: /var/www/html
Each docker-compose of each service looks more or less the same.
The ddev (re)start
is performed from within kla-api
(this is the config shown above), where the ddev config can be found.
Each request to any other service is routed to web
resp. kla-api
.
What did change here or what am I doing wrong?
--- Edit ---
Currently, I suspect the trafik router config as cause for my troubles. In /traefik/config/kla-api.yaml
I find these parts regarding the kla-preview-service
:
...
routers:
kla-api-kla-preview-service-80-http:
entrypoints:
- http-80
rule: HostRegexp(`^kla-preview-service\.ddev\.site$`)
service: "kla-api-kla-preview-service-80"
ruleSyntax: v3
tls: false
# middlewares:
# - "kla-api-redirectHttps"
kla-api-kla-preview-service-8052-http:
entrypoints:
- http-8052
rule: HostRegexp(`^kla-preview-service\.ddev\.site$`)
service: "kla-api-kla-preview-service-8052"
ruleSyntax: v3
tls: false
# middlewares:
# - "kla-api-redirectHttps"
...
kla-api-web-80-http:
entrypoints:
- http-80
rule: HostRegexp(`^kla-api\.ddev\.site$`)|| HostRegexp(`^dba$`)|| HostRegexp(`^kla-backend\.ddev\.site$`)|| HostRegexp(`^kla-configuration-service\.ddev\.site$`)|| HostRegexp(`^kla-file-service\.ddev\.site$`)|| HostRegexp(`^kla-frontend\.ddev\.site$`)|| HostRegexp(`^kla-mail-service\.ddev\.site$`)|| HostRegexp(`^kla-preview-service\.ddev\.site$`)
service: "kla-api-web-80"
ruleSyntax: v3
tls: false
# middlewares:
# - "kla-api-redirectHttps"
kla-api-web-8025-http:
entrypoints:
- http-8025
rule: HostRegexp(`^kla-api\.ddev\.site$`)|| HostRegexp(`^dba$`)|| HostRegexp(`^kla-backend\.ddev\.site$`)|| HostRegexp(`^kla-configuration-service\.ddev\.site$`)|| HostRegexp(`^kla-file-service\.ddev\.site$`)|| HostRegexp(`^kla-frontend\.ddev\.site$`)|| HostRegexp(`^kla-mail-service\.ddev\.site$`)|| HostRegexp(`^kla-preview-service\.ddev\.site$`)
service: "kla-api-web-8025"
ruleSyntax: v3
tls: false
# middlewares:
# - "kla-api-redirectHttps"
...
services:
kla-api-kla-preview-service-80:
loadbalancer:
servers:
- url: http://ddev-kla-api-kla-preview-service:80
kla-api-kla-preview-service-8052:
loadbalancer:
servers:
- url: http://ddev-kla-api-kla-preview-service:8052
...
The docker-compose.preview-service.yaml
contains the following parts:
...
expose:
- 8052
- 8053
...
environment:
HTTP_EXPOSE: 80:80,8052:8052
HTTPS_EXPOSE: 443:80,8053:8052
...
Is my config actually wrong? I am a bit overwhelmed reagrding the config changes in this quite old project ...
I recently updated ddev from v1.21.0
to v1.23.5
.
My configuration contains several services, but uses NOT the web
container itself, because there is not "default" service. I us ddev-router to route the traffic to the specific ports of each container, depending pn the fqdns.
After the update and fixing some issues, ALL traffic is routed to web
and no service is addressed properly anymore.
These are parts of my config (this is an older project, so please do not complain about the php version):
config.yaml
name: kla-api
type: php
docroot: public
php_version: "7.4"
webserver_type: apache-fpm
xdebug_enabled: true
additional_hostnames: []
additional_fqdns:
- kla-backend.ddev.site
- kla-frontend.ddev.site
- kla-mail-service.ddev.site
- kla-file-service.ddev.site
- kla-preview-service.ddev.site
- kla-configuration-service.ddev.site
- kla-api.ddev.site
- dba
database:
type: mariadb
version: "10.4"
use_dns_when_possible: true
composer_version: "2"
web_environment: []
nodejs_version: "16"
corepack_enable: false
docker-compose.api-service.yaml (as a sample)
services:
kla-api.ddev.site:
container_name: "kla-api"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: ${DDEV_APPROOT}
com.ddev.app-type: php
build:
args:
BASE_IMAGE: ddev/ddev-webserver:v1.23.5
DDEV_PHP_VERSION: "7.4"
gid: "20"
uid: "1025"
username: fwtag
context: [xxx]/kla-api/.ddev/.webimageBuild
dockerfile: Dockerfile
external_links:
- ddev-router:kla-api.ddev.site
cap_add:
- SYS_PTRACE
healthcheck:
interval: 1s
retries: 120
start_period: 2m0s
timeout: 2m0s
networks:
ddev_default: null
default: null
expose:
- 8040
- 8041
environment:
PHP_IDE_CONFIG: serverName=kla-api.ddev.site
VIRTUAL_HOST: kla-api.ddev.site
DDEV_PRIMARY_URL: https://kla-api.ddev.site
HTTP_EXPOSE: 80:80,8040:8040
HTTPS_EXPOSE: 443:80,8041:8040
DDEV_WEBSERVER_TYPE: apache-fpm
DDEV_XDEBUG_ENABLED: "true"
DDEV_DOCROOT: public
DOCROOT: public
DDEV_PHP_VERSION: "7.4"
SSH_AUTH_SOCK: /home/.ssh-agent/socket
USER: fwtag
links:
- db:db
restart: "no"
user: "1025:20"
volumes:
- bind:
create_host_path: true
read_only: true
source: [xxx]/kla-api/.ddev
target: /mnt/ddev_config
type: bind
- source: [xxx]/kla-api
target: /var/www/html
type: bind
- source: ddev-global-cache
target: /mnt/ddev-global-cache
type: volume
volume: { }
- source: ddev-ssh-agent_socket_dir
target: /home/.ssh-agent
type: volume
volume: { }
working_dir: /var/www/html
Each docker-compose of each service looks more or less the same.
The ddev (re)start
is performed from within kla-api
(this is the config shown above), where the ddev config can be found.
Each request to any other service is routed to web
resp. kla-api
.
What did change here or what am I doing wrong?
--- Edit ---
Currently, I suspect the trafik router config as cause for my troubles. In /traefik/config/kla-api.yaml
I find these parts regarding the kla-preview-service
:
...
routers:
kla-api-kla-preview-service-80-http:
entrypoints:
- http-80
rule: HostRegexp(`^kla-preview-service\.ddev\.site$`)
service: "kla-api-kla-preview-service-80"
ruleSyntax: v3
tls: false
# middlewares:
# - "kla-api-redirectHttps"
kla-api-kla-preview-service-8052-http:
entrypoints:
- http-8052
rule: HostRegexp(`^kla-preview-service\.ddev\.site$`)
service: "kla-api-kla-preview-service-8052"
ruleSyntax: v3
tls: false
# middlewares:
# - "kla-api-redirectHttps"
...
kla-api-web-80-http:
entrypoints:
- http-80
rule: HostRegexp(`^kla-api\.ddev\.site$`)|| HostRegexp(`^dba$`)|| HostRegexp(`^kla-backend\.ddev\.site$`)|| HostRegexp(`^kla-configuration-service\.ddev\.site$`)|| HostRegexp(`^kla-file-service\.ddev\.site$`)|| HostRegexp(`^kla-frontend\.ddev\.site$`)|| HostRegexp(`^kla-mail-service\.ddev\.site$`)|| HostRegexp(`^kla-preview-service\.ddev\.site$`)
service: "kla-api-web-80"
ruleSyntax: v3
tls: false
# middlewares:
# - "kla-api-redirectHttps"
kla-api-web-8025-http:
entrypoints:
- http-8025
rule: HostRegexp(`^kla-api\.ddev\.site$`)|| HostRegexp(`^dba$`)|| HostRegexp(`^kla-backend\.ddev\.site$`)|| HostRegexp(`^kla-configuration-service\.ddev\.site$`)|| HostRegexp(`^kla-file-service\.ddev\.site$`)|| HostRegexp(`^kla-frontend\.ddev\.site$`)|| HostRegexp(`^kla-mail-service\.ddev\.site$`)|| HostRegexp(`^kla-preview-service\.ddev\.site$`)
service: "kla-api-web-8025"
ruleSyntax: v3
tls: false
# middlewares:
# - "kla-api-redirectHttps"
...
services:
kla-api-kla-preview-service-80:
loadbalancer:
servers:
- url: http://ddev-kla-api-kla-preview-service:80
kla-api-kla-preview-service-8052:
loadbalancer:
servers:
- url: http://ddev-kla-api-kla-preview-service:8052
...
The docker-compose.preview-service.yaml
contains the following parts:
...
expose:
- 8052
- 8053
...
environment:
HTTP_EXPOSE: 80:80,8052:8052
HTTPS_EXPOSE: 443:80,8053:8052
...
Is my config actually wrong? I am a bit overwhelmed reagrding the config changes in this quite old project ...
Share Improve this question edited Nov 23, 2024 at 8:46 fwtag asked Nov 22, 2024 at 19:24 fwtagfwtag 215 bronze badges 7 | Show 2 more comments1 Answer
Reset to default 1Since I could not really find a solution for this, but, however, obviously my whole setup was way to complicated end over-engineered, I ended up in refactor the project to use the second docroot approach which works well (enough). Find more on this in the /.ddev/apache/ folder of your project
Hence this issue is not solved, but might closed for now.
本文标签: After update to ddev v1235all traffic is routed to web containerStack Overflow
版权声明:本文标题:After update to ddev v1.23.5, all traffic is routed to web container - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301290a1931126.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
kla-api.ddev.site
in your docker-compose.api-service.yaml. Instead, name the servicekla-api
. Please recheck the docs for how you're doing some of these things. It looks very complicated. ddev.readthedocs.io/en/stable/users/extend/custom-compose-files/… – rfay Commented Nov 22, 2024 at 19:37