aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/md/docker
diff options
context:
space:
mode:
authorB. van Berkum <dev@dotmpe.com>2017-10-03 00:57:46 +0200
committerB. van Berkum <dev@dotmpe.com>2017-10-03 00:57:46 +0200
commit62a8b0ff6eafddcd091e3f6676b258f44b5f9e5c (patch)
tree93cc61f642ec587f817f37b423238cfb56165e7d /doc/md/docker
parent60ed9b8f4142e99114661b5b8a5562aa75bffb48 (diff)
downloadShaarli-62a8b0ff6eafddcd091e3f6676b258f44b5f9e5c.tar.gz
Shaarli-62a8b0ff6eafddcd091e3f6676b258f44b5f9e5c.tar.zst
Shaarli-62a8b0ff6eafddcd091e3f6676b258f44b5f9e5c.zip
Docker-101: added working systemd config example
Diffstat (limited to 'doc/md/docker')
-rw-r--r--doc/md/docker/docker-101.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/md/docker/docker-101.md b/doc/md/docker/docker-101.md
index 271dcd5b..35a68774 100644
--- a/doc/md/docker/docker-101.md
+++ b/doc/md/docker/docker-101.md
@@ -84,6 +84,11 @@ Note the names and ID's of containers are list in ``docker ps``. You an even typ
84 84
85Access can also be through one or more network ports, or disk volumes. Both are specified on and fixed on ``docker create`` or ``run``. 85Access can also be through one or more network ports, or disk volumes. Both are specified on and fixed on ``docker create`` or ``run``.
86 86
87You can view the console output of the main container process too:
88```bash
89$ docker logs -f <container-name-or-id>
90```
91
87### Docker disk use 92### Docker disk use
88Trying out different images can fill some gigabytes of disk quickly. Besides images, the docker volumes usually take up most disk space. 93Trying out different images can fill some gigabytes of disk quickly. Besides images, the docker volumes usually take up most disk space.
89 94
@@ -93,3 +98,45 @@ If you care only about trying out docker and not about what is running or saved,
93$ docker rmi -f $(docker images -aq) # remove or mark all images for disposal 98$ docker rmi -f $(docker images -aq) # remove or mark all images for disposal
94$ docker volume rm $(docker volume ls -q) # remove all volumes 99$ docker volume rm $(docker volume ls -q) # remove all volumes
95``` 100```
101
102### SystemD config
103Systemd is the process manager of choice on ubuntu. Once you have a ``docker`` service installed, you can add use the following steps to set up Shaarli to run on system start.
104
105```bash
106systemctl enable /etc/systemd/system/docker.shaarli.service
107systemctl start docker.shaarli
108systemctl status docker.*
109journalctl -f # inspect system log if needed
110```
111
112You will need sudo or a root terminal to perform some or all of the steps above. Here are the contents for the service file:
113```
114[Unit]
115Description=Shaarli Bookmark Manager Container
116After=docker.service
117Requires=docker.service
118
119
120[Service]
121Restart=always
122
123# Put any environment you want in here, like $host- or $domainname in this example
124EnvironmentFile=/etc/sysconfig/box-environment
125
126# It's just an example..
127ExecStart=/usr/bin/docker run \
128 -p 28010:80 \
129 --name ${hostname}-shaarli \
130 --hostname shaarli.${domainname} \
131 \
132 -v /srv/docker-volumes-local/shaarli-data:/var/www/shaarli/data:rw \
133 -v /etc/localtime:/etc/localtime:ro \
134 \
135 shaarli/shaarli:latest
136
137ExecStop=/usr/bin/docker rm -f ${hostname}-shaarli
138
139
140[Install]
141WantedBy=multi-user.target
142```