-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic systemd unit files to run a docker deployment.
These are still incomplete and are missing documentation on how they interact and how the system is supposed to interact with them.
- Loading branch information
Showing
7 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Timer for ZMS/Zope to restart and pull os updates | ||
# Propagate start and stop from target | ||
PartOf=zms.target | ||
# Start after target | ||
After=zms.target | ||
|
||
[Timer] | ||
OnBootSec=10m | ||
RandomizedDelaySec=1h | ||
OnCalendar=daily | ||
|
||
[Install] | ||
WantedBy=timers.target | ||
WantedBy=zms.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=ZMS/Zope ZEO zeopack | ||
After=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
User=zope | ||
# I do not know yet how to execute this correctly | ||
# may require a script that execs into the zeo container to trigger this? | ||
ExecStart=/home/zope/instance/bin/zeopack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Timer for ZMS/Zope to restart and pull os updates | ||
# Propagate start and stop from target | ||
PartOf=zms.target | ||
# Start after target | ||
After=zms.target | ||
|
||
[Timer] | ||
OnBootSec=10m | ||
RandomizedDelaySec=1h | ||
OnCalendar=daily | ||
|
||
[Install] | ||
WantedBy=timers.target | ||
WantedBy=zms.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Unit] | ||
Description=ZMS/Zope and all of its dependencies | ||
After=network-online.target | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[Unit] | ||
Description=ZMS/Zope | ||
|
||
After=docker.service | ||
Requires=docker.service | ||
|
||
Requires=memcached.service | ||
After=memcached.service | ||
|
||
Requires=mariadb.service | ||
After=mariadb.service | ||
|
||
|
||
[Service] | ||
#User=zope | ||
#Group=zope | ||
Restart=always | ||
|
||
Environment="ZOPE_PUBLIC_PORT=%i" | ||
Environment="DOCKER_IMAGE=localhost/zms DOCKER_TAG=latest" | ||
|
||
TimeoutStartSec=0 | ||
PrivateTmp=true | ||
|
||
## These ExecStartPre commands are meant to be used together with a | ||
## systemd-timer or cron job that regularly restarts the service. | ||
## Then these commands rebuild the docker container to update operating | ||
## system packages and thus fix security bugs in the base os inside the docker container. | ||
## FIXME /path/to/oidc_client/ needs to point to the root folder of the source code of the oidc_client | ||
# ExecStartPre=/usr/bin/docker build --no-cache --pull --tag $DOCKER_IMAGE:$DOCKER_TAG /path/to/oidc_client/ | ||
# ExecStartPre=-/usr/bin/docker stop $DOCKER_IMAGE | ||
ExecStart=/usr/bin/docker run --rm --publish 127.0.0.1:$ZOPE_PUBLIC_PORT:80 --name $DOCKER_IMAGE $DOCKER_IMAGE:$DOCKER_TAG | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
WantedBy=zms.target |