{"id":925,"date":"2022-03-22T12:33:22","date_gmt":"2022-03-22T12:33:22","guid":{"rendered":"https:\/\/mklasen.com\/?p=925"},"modified":"2022-04-15T17:36:54","modified_gmt":"2022-04-15T17:36:54","slug":"halcyon-part-2-the-docker-compose-yml-configuration","status":"publish","type":"post","link":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/","title":{"rendered":"Halcyon Part 2: The docker-compose.yml configuration"},"content":{"rendered":"\n

List of variables and ip addresses used: https:\/\/mklasen.com\/halcyon-list-of-variables-and-ip-addresses\/<\/a><\/p>\n\n\n\n

While the components are sitting on my desk, waiting to be unpacked, and while I figure out how to approach this (blogging? video? livestream? unpack video?), we can have a look at the server configuration.<\/p>\n\n\n\n

Let’s start by creating a Github repo in which we’ll push the server configuration. You can find it here:<\/p>\n\n\n\n

https:\/\/github.com\/mklasen\/halcyon<\/a><\/p>\n\n\n\n

The docker-compose.yml file<\/h2>\n\n\n\n

In the previous blog post I spoke about the service we want to run, ordered by priority:<\/p>\n\n\n\n

  1. DNS service<\/li>
  2. nginx-proxy for forwarding requests<\/li>
  3. catch-all mailserver<\/li>
  4. VPN service<\/li>
  5. Backup service for iPhones<\/li>
  6. TimeMachine backup service<\/li><\/ol>\n\n\n\n

    I’ll copy the list above and add it to the docker-compose.yml file, then we’ll build from there.<\/p>\n\n\n\n

    version: \"3\"\n\n# What we want to run:\n# - DNS service\n# - nginx-proxy for forwarding requests\n# - VPN service\n# - Catch-all mailserver\n# - Backup service for iPhones\n# - TimeMachine backup service<\/code><\/pre>\n\n\n\n

    https:\/\/github.com\/mklasen\/halcyon\/blob\/88c105ba1fd4cfd25513becff48c9a3c135889dd\/docker-compose.yml<\/a><\/p>\n\n\n\n

    Adding the DNS service<\/strong><\/h4>\n\n\n\n

    We’ll use the cytopia\/bind image for this service. Learn more about this image here<\/a> and here<\/a>.<\/p>\n\n\n\n

    This is the moment that we’ll define the custom TLD as well, which is entered in the DNS_A argument. Hm.. how about “.hyc”?<\/p>\n\n\n\n

    This is the full configuration after adding the dns service:<\/p>\n\n\n\n

    version: \"3\"\n\n# What we want to run:\n# - DNS service\n# - nginx-proxy for forwarding requests\n# - VPN service\n# - Catch-all mailserver\n# - Backup service for iPhones\n# - TimeMachine backup service\n\nservices:\n  dns:\n    container_name: dns\n    image: cytopia\/bind:0.28\n    hostname: bind\n    ports:\n      - \"53:53\/tcp\"\n      - \"53:53\/udp\"\n    dns:\n      - 127.0.0.1\n    environment:\n      - DNS_A='*.hyc=192.168.2.70'\n      - DNS_FORWARDER=192.168.1.1\n      - DOCKER_LOGS=1\n      - DEBUG_ENTRYPOINT=2\n    restart: always<\/code><\/pre>\n\n\n\n

    We’re linking port 53 to this service. This is the port that is used for DNS requests. With “DNS_A” we’re saying: Handle all requests for .hyc by “192.168.2.70”. We’re forwarding other DNS requests to “192.168.1.1”. Info and queries are logged to docker with “DOCKER_LOGS=1” and by setting “DEBUG_ENTRYPOINT=2” we log all info, warnings, errors and comments that are executed. <\/p>\n\n\n\n

    Setting up nginx-proxy<\/h4>\n\n\n\n

    Okay, moving forward to nginx-proxy. Keep in mind: I’m just defining configuration now. At the time of writing, this configuration has not been tested. <\/p>\n\n\n\n

    We’ll keep the nginx-proxy configuration simple for now. Later on, we’ll dive into setting up shared volumes for configuration of the nginx-proxy container.<\/p>\n\n\n\n

      nginx-proxy:\n    image: jwilder\/nginx-proxy\n    container_name: nginx-proxy\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    restart: always<\/code><\/pre>\n\n\n\n

    The catch-all mailservice<\/h4>\n\n\n\n

    This will actually be the first service that we’ll set environment variables for that will be resolved by nginx-proxy later on. Below you’ll see that we define VIRTUAL_HOST and VIRTUAL_PORT. We’re basically telling nginx-proxy to forward traffic from VIRTUAL_HOST to this container on VIRTUAL_PORT. The mailhog service is accessible on the web via 8025, and SMTP runs on 1025, hence the expose part.<\/p>\n\n\n\n

      catchall:\n    container_name: catchall\n    image: mailhog\/mailhog:latest\n    expose:\n      - '8025'\n      - '1025'\n    environment:\n      VIRTUAL_HOST: \"mail.hyc\"\n      VIRTUAL_PORT: 8025\n    restart: always<\/code><\/pre>\n\n\n\n

    Alright, that’s it for today. We have a nice configuration to start with once we get this hardware up and running. I’m pretty sure this configuration will not run flawlessly upon start, but we’ll fix that on the go.<\/p>\n\n\n\n

    See you in part 3!<\/strong><\/p>\n\n\n\n

    Repository state after the changes in this blog:<\/p>\n\n\n\n

    https:\/\/github.com\/mklasen\/halcyon\/tree\/5db4b2e470c298780b4ae9724c74b2d0e2028f5a<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

    List of variables and ip addresses used: https:\/\/mklasen.com\/halcyon-list-of-variables-and-ip-addresses\/ While the components are sitting on my desk, waiting to be unpacked, and while I figure out how to approach this (blogging? video? livestream? unpack video?), we can have a look at the server configuration. Let’s start by creating a Github repo in which we’ll push the […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[48],"tags":[],"acf":[],"yoast_head":"\nHalcyon Part 2: The docker-compose.yml configuration - Marinus Klasen<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Halcyon Part 2: The docker-compose.yml configuration - Marinus Klasen\" \/>\n<meta property=\"og:description\" content=\"List of variables and ip addresses used: https:\/\/mklasen.com\/halcyon-list-of-variables-and-ip-addresses\/ While the components are sitting on my desk, waiting to be unpacked, and while I figure out how to approach this (blogging? video? livestream? unpack video?), we can have a look at the server configuration. Let’s start by creating a Github repo in which we’ll push the […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/\" \/>\n<meta property=\"og:site_name\" content=\"Marinus Klasen\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/marinus.klasen\" \/>\n<meta property=\"article:author\" content=\"http:\/\/facebook.com\/marinus.klasen\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-22T12:33:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-15T17:36:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mklasen.com\/content\/uploads\/2022\/03\/docker-compose-yml-setup.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2600\" \/>\n\t<meta property=\"og:image:height\" content=\"1508\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Marinus Klasen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/marinusklasen\" \/>\n<meta name=\"twitter:site\" content=\"@marinusklasen\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marinus Klasen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/\"},\"author\":{\"name\":\"Marinus Klasen\",\"@id\":\"https:\/\/mklasen.com\/#\/schema\/person\/bbad02776afb72dfba2ebfe1956a4e29\"},\"headline\":\"Halcyon Part 2: The docker-compose.yml configuration\",\"datePublished\":\"2022-03-22T12:33:22+00:00\",\"dateModified\":\"2022-04-15T17:36:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/\"},\"wordCount\":468,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/mklasen.com\/#\/schema\/person\/bbad02776afb72dfba2ebfe1956a4e29\"},\"articleSection\":[\"Halcyon\"],\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/\",\"url\":\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/\",\"name\":\"Halcyon Part 2: The docker-compose.yml configuration - Marinus Klasen\",\"isPartOf\":{\"@id\":\"https:\/\/mklasen.com\/#website\"},\"datePublished\":\"2022-03-22T12:33:22+00:00\",\"dateModified\":\"2022-04-15T17:36:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mklasen.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Halcyon\",\"item\":\"https:\/\/mklasen.com\/halcyon\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Halcyon Part 2: The docker-compose.yml configuration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mklasen.com\/#website\",\"url\":\"https:\/\/mklasen.com\/\",\"name\":\"Marinus Klasen\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/mklasen.com\/#\/schema\/person\/bbad02776afb72dfba2ebfe1956a4e29\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mklasen.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"nl-NL\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/mklasen.com\/#\/schema\/person\/bbad02776afb72dfba2ebfe1956a4e29\",\"name\":\"Marinus Klasen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/mklasen.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/mklasen.com\/content\/uploads\/2021\/01\/DONE1171.jpg\",\"contentUrl\":\"https:\/\/mklasen.com\/content\/uploads\/2021\/01\/DONE1171.jpg\",\"width\":1500,\"height\":1000,\"caption\":\"Marinus Klasen\"},\"logo\":{\"@id\":\"https:\/\/mklasen.com\/#\/schema\/person\/image\/\"},\"description\":\"Marinus has been working in software\/web development for more than a decade. Since 2020 his attention shifted on sharing knowledge and developing products and tools for sharing knowledge. Marinus Klasen on Twitter\",\"sameAs\":[\"http:\/\/facebook.com\/marinus.klasen\",\"https:\/\/nl.linkedin.com\/in\/marinusklasen\",\"https:\/\/twitter.com\/http:\/\/twitter.com\/marinusklasen\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Halcyon Part 2: The docker-compose.yml configuration - Marinus Klasen","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/","og_locale":"nl_NL","og_type":"article","og_title":"Halcyon Part 2: The docker-compose.yml configuration - Marinus Klasen","og_description":"List of variables and ip addresses used: https:\/\/mklasen.com\/halcyon-list-of-variables-and-ip-addresses\/ While the components are sitting on my desk, waiting to be unpacked, and while I figure out how to approach this (blogging? video? livestream? unpack video?), we can have a look at the server configuration. Let’s start by creating a Github repo in which we’ll push the […]","og_url":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/","og_site_name":"Marinus Klasen","article_publisher":"http:\/\/facebook.com\/marinus.klasen","article_author":"http:\/\/facebook.com\/marinus.klasen","article_published_time":"2022-03-22T12:33:22+00:00","article_modified_time":"2022-04-15T17:36:54+00:00","og_image":[{"width":2600,"height":1508,"url":"https:\/\/mklasen.com\/content\/uploads\/2022\/03\/docker-compose-yml-setup.png","type":"image\/png"}],"author":"Marinus Klasen","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/marinusklasen","twitter_site":"@marinusklasen","twitter_misc":{"Written by":"Marinus Klasen","Est. reading time":"3 minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/#article","isPartOf":{"@id":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/"},"author":{"name":"Marinus Klasen","@id":"https:\/\/mklasen.com\/#\/schema\/person\/bbad02776afb72dfba2ebfe1956a4e29"},"headline":"Halcyon Part 2: The docker-compose.yml configuration","datePublished":"2022-03-22T12:33:22+00:00","dateModified":"2022-04-15T17:36:54+00:00","mainEntityOfPage":{"@id":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/"},"wordCount":468,"commentCount":0,"publisher":{"@id":"https:\/\/mklasen.com\/#\/schema\/person\/bbad02776afb72dfba2ebfe1956a4e29"},"articleSection":["Halcyon"],"inLanguage":"nl-NL","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/","url":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/","name":"Halcyon Part 2: The docker-compose.yml configuration - Marinus Klasen","isPartOf":{"@id":"https:\/\/mklasen.com\/#website"},"datePublished":"2022-03-22T12:33:22+00:00","dateModified":"2022-04-15T17:36:54+00:00","breadcrumb":{"@id":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/mklasen.com\/halcyon-part-2-the-docker-compose-yml-configuration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mklasen.com\/"},{"@type":"ListItem","position":2,"name":"Halcyon","item":"https:\/\/mklasen.com\/halcyon\/"},{"@type":"ListItem","position":3,"name":"Halcyon Part 2: The docker-compose.yml configuration"}]},{"@type":"WebSite","@id":"https:\/\/mklasen.com\/#website","url":"https:\/\/mklasen.com\/","name":"Marinus Klasen","description":"","publisher":{"@id":"https:\/\/mklasen.com\/#\/schema\/person\/bbad02776afb72dfba2ebfe1956a4e29"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mklasen.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"nl-NL"},{"@type":["Person","Organization"],"@id":"https:\/\/mklasen.com\/#\/schema\/person\/bbad02776afb72dfba2ebfe1956a4e29","name":"Marinus Klasen","image":{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/mklasen.com\/#\/schema\/person\/image\/","url":"https:\/\/mklasen.com\/content\/uploads\/2021\/01\/DONE1171.jpg","contentUrl":"https:\/\/mklasen.com\/content\/uploads\/2021\/01\/DONE1171.jpg","width":1500,"height":1000,"caption":"Marinus Klasen"},"logo":{"@id":"https:\/\/mklasen.com\/#\/schema\/person\/image\/"},"description":"Marinus has been working in software\/web development for more than a decade. Since 2020 his attention shifted on sharing knowledge and developing products and tools for sharing knowledge. Marinus Klasen on Twitter","sameAs":["http:\/\/facebook.com\/marinus.klasen","https:\/\/nl.linkedin.com\/in\/marinusklasen","https:\/\/twitter.com\/http:\/\/twitter.com\/marinusklasen"]}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Marinus Klasen","author_link":"https:\/\/mklasen.com\/author\/mklasen\/"},"_links":{"self":[{"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/posts\/925"}],"collection":[{"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/comments?post=925"}],"version-history":[{"count":4,"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/posts\/925\/revisions"}],"predecessor-version":[{"id":966,"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/posts\/925\/revisions\/966"}],"wp:attachment":[{"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/media?parent=925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/categories?post=925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mklasen.com\/wp-json\/wp\/v2\/tags?post=925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}