Browse Source

Add docker-compose snippets

master
Chris Smith 4 years ago
parent
commit
706de3e3ea
Signed by: Chris Smith <chris@chameth.com> GPG Key ID: 3A2D4BBDC4A3C9A9
1 changed files with 48 additions and 0 deletions
  1. 48
    0
      content/docs/software/docker.adoc

+ 48
- 0
content/docs/software/docker.adoc View File

@@ -0,0 +1,48 @@
1
++++
2
++++
3
+
4
+:source-highlighter: pygments
5
+
6
+== Docker
7
+
8
+=== Compose file snippets
9
+
10
+==== General template
11
+
12
+[source,yaml]
13
+----
14
+version: '3.7'
15
+
16
+services:
17
+  name:
18
+    image: x/y:z
19
+    volumes:
20
+      - host/path:/container/path
21
+      - custom:/container/path
22
+    environment:
23
+      FOO: bar
24
+    restart: always
25
+
26
+networks:
27
+  custom:
28
+    external: true
29
+
30
+volumes:
31
+  custom:
32
+----
33
+
34
+==== MySQL/MariaDB
35
+
36
+[source,yaml]
37
+----
38
+  db:
39
+    image: mariadb:latest
40
+    volumes:
41
+      - mariadb_data:/var/lib/mysql
42
+    restart: always
43
+    environment:
44
+      MYSQL_DATABASE: app_name
45
+      MYSQL_USER: app_name
46
+      MYSQL_PASSWORD: app_password
47
+      MYSQL_ROOT_PASSWORD: random_password
48
+----

Loading…
Cancel
Save