diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bd5d5e..39221f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +### Changed +- Set the working directory (see: https://www.freedesktop.org/software/systemd/man/systemd.exec.html) for the docker-compose systemd services. Otherwise docker-compose cannot locate `env_file`s (see: https://docs.docker.com/compose/compose-file/#/envfile) + ## [v0.1.0-alpha] - 2016-12-18 The prototype diff --git a/installer.go b/installer.go index 302b900..935cb29 100644 --- a/installer.go +++ b/installer.go @@ -77,8 +77,9 @@ Description={{ .ProjectName }} Service After=network.target [Service] -ExecStart=/usr/bin/env docker-compose -p "{{ .ProjectName }}" -f "{{ .ProjectDirectory }}/{{ .DockerComposeFile }}" up -ExecStop=/usr/bin/env docker-compose -p "{{ .ProjectName }}" -f "{{ .ProjectDirectory }}/{{ .DockerComposeFile }}" down +WorkingDirectory={{ .ProjectDirectory }} +ExecStart=/usr/bin/env docker-compose -p "{{ .ProjectName }}" -f "{{ .DockerComposeFile }}" up +ExecStop=/usr/bin/env docker-compose -p "{{ .ProjectName }}" -f "{{ .DockerComposeFile }}" down [Install] WantedBy=network-online.target