Skip to content

How to exploit docker-compose default files #183

@CharlesGodwin

Description

@CharlesGodwin

docker-compose opens several files by default as described here. These are the default docker-compose.yml file and a default override file named docker-compose.override.yml which acts as an override similar to the docker-override.yml file used in the repo.
docker-compose also opens, by default, an environment file named .env. Refer to this documentation.

These files are very useful for just-in-time override setting and the .env file allows you to define stack wide environment values.

However using these files in the default ~/IOTstack directory will cause git to identify the files for tracking. The solution is to tell git to ignore them. The technique I use is to create a file named .gitignore-iotstack in the directory and then tell git to use that as a configuration file for exclusion. This setup will not impact the default git settings for this repo.

Here's what to do:

  1. create a file named .gitignore-iotstackwith this content:
#
# Use the following command to set up extended exclude list for ./IOTstack
# git config core.excludesfile .gitignore-iotstack
#
.gitignore-iotstack
docker-compose.override.yml
.env
  1. run this git command git config core.excludesfile .gitignore-iotstack

That should do it. NOTE this does not take care of these files being backed up as defined in PR #183 but can be done now and dropped if the PR is merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions