Changed docker startup process

This commit is contained in:
Kevin Veen-Birkenbach 2020-12-29 13:20:55 +01:00
parent ae171e52cf
commit e3cafd3f0a
3 changed files with 6 additions and 27 deletions

View File

@ -1,12 +0,0 @@
[Unit]
Description=Mailu service
After=network.target docker.service
[Service]
Type=simple
WorkingDirectory=/usr/local/bin/mailu
ExecStart=/bin/docker-compose up
ExecStop=/bin/docker-compose down
[Install]
WantedBy=multi-user.target

View File

@ -1,8 +1,5 @@
--- ---
- name: "restart mailu" - name: rescreate mailu
systemd: command:
name: mailu cmd: docker-compose -p mailu up -d --force-recreate
state: restarted chdir: /usr/local/bin/mailu/
enabled: yes
daemon_reload: yes
become: yes

View File

@ -21,14 +21,8 @@
- name: add docker-compose.yml - name: add docker-compose.yml
template: src=docker-compose.yml.j2 dest=/usr/local/bin/mailu/docker-compose.yml template: src=docker-compose.yml.j2 dest=/usr/local/bin/mailu/docker-compose.yml
notify: restart mailu notify: rescreate mailu
- name: add mailu.env - name: add mailu.env
template: src=mailu.env.j2 dest=/usr/local/bin/mailu/mailu.env template: src=mailu.env.j2 dest=/usr/local/bin/mailu/mailu.env
notify: restart mailu notify: rescreate mailu
- name: "install mailu service"
copy:
src: "mailu.service"
dest: "/etc/systemd/system/mailu.service"
notify: restart mailu