Open ttk opened 1 month ago
@ttk I think this works as expected; the overrides
documentation notes that it follows Docker Compose v3 syntax (https://docs.lando.dev/core/v3/services/lando.html#overrides) ...Docker volumes are referenced relatively from the build root AFAIK, which I believe is what you're experiencing. See https://docs.docker.com/reference/compose-file/services/#volumes for the relevant Docker Compose docs.
Essentially, once you get into overrides or making custom type: lando
services, you're playing more directly with Docker Compose and Lando should respect those rules.
LMK if that makes sense or if I missed something!
@reynoldsalec What is confusing for me is why behavior is different specifically for the appserver_nginx
service in this symfony
recipe.
For nginx:
services:
appserver_nginx:
overrides:
volumes:
- ./vendor:/app/vendor
Gets converted to the following raw docker compose spec (note the relative path):
services:
appserver_nginx:
volumes:
- './vendor:/app/vendor'
Whereas if I do the same for the appserver
service in the same symfony
recipe:
services:
appserver:
volumes:
- './vendor:/app/vendor'
I get the follow raw docker compose spec, where the volume source path was translated to the absolute path to my lando app root.
services:
appserver:
volumes:
- 'C:\tmp\landotest2\vendor:/app/vendor'
The translation of the relative paths to absolute path to my lando app root directory is what I expect for all services. I understand that using overrides
is an advanced, low level feature that not a lot of people are going to use, but I figured it's worth reporting in case this is a bug.
Apologies for the late response here. I'm wondering if this is something Windows specific, which sadly is not my area of expertise.
I noticed that you're using quotes in the appserver
example, does it operate differently if you remove those?
When adding an extra volume to the
appserver_nginx
container, the source directory on the host is wrong as it seems to be using the location of the underlying docker compose file location instead of my lando app root directory for the relative path. Best demonstrated by example:Simple lando config:
Expected bind mounts:
%LANDO_APP_ROOT%/vendor:/app/vendor
Actual bind mounts:
%USERPROFILE%/.lando/compose/test:/app/vendor
I tested the same scenario with the
nginx
lando plugin directly, and it mounted the expected directory, so I think it something to do with the way the symfony lando plugin integrates with nginx.OS: Windows 11 (not sure if that matters.