koopmac
koopmac

Reputation: 966

How can I build a docker-compose image while using git?

I’m looking to upgrade my app to run with docker-compose rather than using systemd unit files with docker. However my web app uses git so there is no .yml file on my server. Every time I try to build a docker-compose image, my .yml file can’t be found on the server. It returns:

ERROR:
    Can't find a suitable configuration file in this directory or any
    parent. Are you in the right directory?

    Supported filenames: docker-compose.yml, docker-compose.yaml

How can I build a docker-compose image while using a git remote repo?

Upvotes: 1

Views: 357

Answers (1)

VonC
VonC

Reputation: 1329522

You need to generate a docker-compose.yml file (or copy it from an external referential) on your server.

That can be achieve through a post-receive (server-side) hook which can ensure, each time a new commit is pushed that:

  • the docker-compose.yml is still there
  • if not, copy/generate it

Upvotes: 1

Related Questions