In a docker-compose, we can have multiple volumes mapping relative to the project folder:
Example with an httpd server aside the code:
test:
volumes:
- ./:/workspace
httpd:
volumes:
- ./www:/usr/local/apache2/htdocs/
Problem:
In a devcontainer, the "." is mapped on the host, where the folder does not exsits
Possible solutions:
- We can remap the "." to the data volume holding the code with the syntax ${WORKSPACE_SOURCE:-.}, but we need to define the code_volume variable
- We can add a docker-compose.override.yml generated automatically by devcontainer
While the second solution seems cleaner for newbies, the first solution seems easier to implement and more transparent for the average user (it requires a bit of documentation though).
Inspirations:
In a docker-compose, we can have multiple volumes mapping relative to the project folder:
Example with an httpd server aside the code:
Problem:
In a devcontainer, the "." is mapped on the host, where the folder does not exsits
Possible solutions:
While the second solution seems cleaner for newbies, the first solution seems easier to implement and more transparent for the average user (it requires a bit of documentation though).
Inspirations: