|
@@ -1,3 +1,64 @@
|
1
|
|
-# deploy-docker
|
|
1
|
+Deploy docker as a service
|
|
2
|
+==========================
|
2
|
3
|
|
3
|
|
-Build a docker image and push it to a registry.
|
|
4
|
+Download a git repository which has a Dockerfile, build it locally, push it to a registry and create a systemd service to manage it.
|
|
5
|
+
|
|
6
|
+Requirements
|
|
7
|
+------------
|
|
8
|
+
|
|
9
|
+None.
|
|
10
|
+
|
|
11
|
+Role Variables
|
|
12
|
+--------------
|
|
13
|
+
|
|
14
|
+* `git_repository`: The repository in which the dockerfile is located.
|
|
15
|
+* `git_repository_destination`: Local path in which to clone the git repository.
|
|
16
|
+* `git_repository_tag`: Version to use of the git repository.
|
|
17
|
+* `service_name`: Name of the systemd service.
|
|
18
|
+* `docker_registry`: Domain of the registry with write access.
|
|
19
|
+* `docker_registry_read`: Domain of the registry with read access.
|
|
20
|
+* `registry_user`: User used to authenticate with the registry.
|
|
21
|
+* `registry_password`: Password used to authenticate with the registry.
|
|
22
|
+* `docker_tag`: Docker tag.
|
|
23
|
+* `docker_command`: Docker command used to launch the container.
|
|
24
|
+
|
|
25
|
+Dependencies
|
|
26
|
+------------
|
|
27
|
+
|
|
28
|
+None.
|
|
29
|
+
|
|
30
|
+Example Playbook
|
|
31
|
+----------------
|
|
32
|
+
|
|
33
|
+```yaml
|
|
34
|
+- hosts: servers
|
|
35
|
+ vars:
|
|
36
|
+ git_repository: https://git.digitales.cslabrecha.org/La_Brecha_Digital/prosody-docker
|
|
37
|
+ git_repository_destination: /home/drymer/Proyectos/LaBrechaDigital/prosody-docker
|
|
38
|
+ git_repository_tag: v0.1.1
|
|
39
|
+ service_name: prosody
|
|
40
|
+ docker_registry: r.daemons.it
|
|
41
|
+ docker_registry_read: registry.daemons.it
|
|
42
|
+ registry_user: drymer
|
|
43
|
+ registry_password: whatever
|
|
44
|
+ docker_tag: "{{ git_repository_tag }}"
|
|
45
|
+ docker_command: /usr/bin/docker run --rm -i -v /root/docker/prosody/conf:/etc/prosody/ -v /root/docker/prosody/ssl:/etc/prosody/certs/ -v /root/docker/prosody/modules:/usr/lib/prosody/modules/extra:ro -v /root/docker/prosody/logs:/var/log/prosody/ -v /root/docker/prosody/images/:/var/lib/prosody/ -e LOCAL=admin -e DOMAIN=daemons.it -e PASSWORD=qv9NEdTBYxBv78rIfNOBVZIeICuRc -p 5222:5222 -p 5269:5269 -p 5280:5280 -p 5281:5281 --name "{{ service_name }}" "{{ docker_registry_read }}/{{ service_name }}"
|
|
46
|
+ roles:
|
|
47
|
+ - { role: deploy-docker}
|
|
48
|
+```
|
|
49
|
+
|
|
50
|
+Compatible
|
|
51
|
+----------
|
|
52
|
+
|
|
53
|
+With:
|
|
54
|
+ - Debian 9
|
|
55
|
+
|
|
56
|
+License
|
|
57
|
+-------
|
|
58
|
+
|
|
59
|
+GPL3
|
|
60
|
+
|
|
61
|
+Author Information
|
|
62
|
+------------------
|
|
63
|
+
|
|
64
|
+drymer [ EN ] autistici.org
|