I made it possible to edit the docker container locally using VScode Remote Container, but I stumbled a little when connecting to git, so I made a note.
Add the following to .devcontainer/docker-compose.yml
yml:.devcontainer/docker-compose.yml
volumes:
- .:/workspace:cached
- ~/.ssh:/root/.ssh #ssh key
- ~/.gitconfig:/root/.gitconfig #git settings
Now you can use your local ssh key inside the container as well.