I'm trying to prevent a list of files and folders from my Drupal composer project to be included in the docker image, but as an unintended side effect it's also excluding a few folders which aren't explicitly defined in the .dockerignore. Here's the file I'm working with:
# root files
.gitignore
.gitmodules
.travis.yml
.gitlab-ci.yml
docker-compose.yml
LICENSE
phpunit.xml.dist
README.md
# folders
.c9
.git
backups/
vendor/
web/core/
web/modules/contrib/
web/profiles/
web/themes/contrib/
# web files
web/.csslintrc
web/.editorconfig
web/.eslintrc
web/.eslintignore
web/.gitattributes
web/.htaccess
# web sites files
web/sites/development.services.yml
web/sites/example.settings.local.php
web/sites/example.sites.php
# web sites default files
web/sites/default/files/
web/sites/default/default.services.yml
web/sites/default/settings.local.php
<all combinations of lines below, one at a time>
I've defined the folders I want to include at the bottom, I've tried all the combinations I could think of below. So far no luck and ran out of things to try.
# don't ignore comes last
!web/themes/custom
!web/libraries
# don't ignore comes last
!web/themes/custom/
!web/libraries/
# don't ignore comes last
!web/themes/custom/*
!web/libraries/*
# don't ignore comes last
*!web/themes/custom/*
*!web/libraries/*
I also tried to uncomment every folder, and the web/themes/custom and web/libraries folders still aren't showing up in my docker image. I also have a .gitignore file which contains these folders. Maybe this is responsible for this strange behavior?
Any help would be appreciated.
I was building the image with Gitlab CI, and I forgot that my git repository didn't have the folders that I was trying to COPY. Only my local development environment had the folders.