superlinear-ai / poetry-cookiecutter

🍪 Poetry Cookiecutter is a modern Cookiecutter template for scaffolding Python packages and apps
GNU Affero General Public License v3.0
252 stars 37 forks source link

fix: enable cloning into Docker volume #173

Closed lsorber closed 1 year ago

lsorber commented 1 year ago

Currently, you cannot use the new Open in Dev Containers badge because the docker-compose.yml file tries to mount the current directory, which is not compatible with cloning the repo into a (named) Docker volume first.

To support both use cases (mounting the repo from a local directory, and mounting the repo from a Docker volume), we first expose Dev Container's localWorkspaceFolder variable to Docker Compose, and then mount that dynamically [1].

[1] https://stackoverflow.com/questions/60778464/vscode-devcontainer-json-mounts-not-working