+++
+++

:source-highlighter: pygments

== Docker

=== Compose file snippets

==== General template

[source,yaml]
----
version: '3.7'

services:
  name:
    image: x/y:z
    volumes:
      - host/path:/container/path
      - custom:/container/path
    environment:
      FOO: bar
    restart: always

networks:
  custom:
    external: true

volumes:
  custom:
----

==== MySQL/MariaDB

[source,yaml]
----
  db:
    image: mariadb:latest
    volumes:
      - mariadb_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_DATABASE: app_name
      MYSQL_USER: app_name
      MYSQL_PASSWORD: app_password
      MYSQL_ROOT_PASSWORD: random_password
----
