13
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Systemdで作業ディレクトリを指定する方法

Last updated at Posted at 2019-07-08

docker-composeを実行する際など、カレントディレクトリ(作業ディレクトリ)指定したい場合があります。
このような場合は、実行するserviceファイルに対して、WorkingDirectoryを[service]に記述します。

[Unit]
Description=hoge
After=fuga.service
Requires=fuga.service

[Service]
Type=simple
WorkingDirectory=/opt/hoge/docker-compose
ExecStart=/usr/local/bin/docker-compose -f /opt/hoge/docker-compose/docker-compose.yml up
Restart=yes

[Install]
WantedBy=multi-user.target

参考

13
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?