<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Veselin Stoyanov on Medium]]></title>
        <description><![CDATA[Stories by Veselin Stoyanov on Medium]]></description>
        <link>https://medium.com/@stoyanov.veseline?source=rss-7f155c51f1fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nseSSJPGP-Q3bfPoG2PWXQ.jpeg</url>
            <title>Stories by Veselin Stoyanov on Medium</title>
            <link>https://medium.com/@stoyanov.veseline?source=rss-7f155c51f1fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 19:57:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stoyanov.veseline/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pushing Docker images to a private registry with Docker Compose]]></title>
            <link>https://medium.com/@stoyanov.veseline/pushing-docker-images-to-a-private-registry-with-docker-compose-d2797097751?source=rss-7f155c51f1fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2797097751</guid>
            <category><![CDATA[docker-registry]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[private-docker-registry]]></category>
            <dc:creator><![CDATA[Veselin Stoyanov]]></dc:creator>
            <pubDate>Sat, 18 May 2019 16:56:55 GMT</pubDate>
            <atom:updated>2019-05-18T16:56:55.315Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8XomXrp9lTwu3B-C" /><figcaption>Photo by <a href="https://unsplash.com/@aligns?utm_source=medium&amp;utm_medium=referral">Jordan Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>TLDR;<br></strong>The value of your service’s image configuration option should begin with your private registry host e.g.:</p><blockquote>image: my-registry-host:5000/myproject/myapp:latest</blockquote><p>Recently I was looking for a way to push services’ images of a Docker Compose project to a private registry. In this article I’m going to save you some guesswork as the process is a bit ambiguous.</p><p>Before we go any further let’s first set up the stage.<br>We have a simple <strong>docker-compose.yml</strong> file with the following contents:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7cf81194e8308759ee9e20dc0a797f29/href">https://medium.com/media/7cf81194e8308759ee9e20dc0a797f29/href</a></iframe><p>I want to build the image and push it to my private Docker registry.<br><strong>docker-compose build</strong></p><p>So far so good. Everything builds well. I decide to check my local images:<br><strong>docker images</strong></p><p>And the first issue I notice is the bad naming of my image:<br><strong>“myprojectname_myapp latest”</strong></p><p>Easy fix — if you specify image as well as build configuration options, docker-compose will build the image with the specified image name and tag, <a href="https://docs.docker.com/compose/compose-file/#build">as described in the docs</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd780d348648c43def17327da970f9cf/href">https://medium.com/media/dd780d348648c43def17327da970f9cf/href</a></iframe><p>Now my image has appropriate naming and I want to push it. With the current setup, however, <strong>docker-compose push</strong> will try to push the project’s images to the Docker Hub registry. I don’t want this to happen.</p><p>At first glance <a href="https://docs.docker.com/compose/compose-file/">the compose file reference</a> doesn’t provide neither configuration nor information on how to push images to a private registry.</p><blockquote>If you want to push an image to a private registry you need to <a href="https://docs.docker.com/engine/reference/commandline/push/#push-a-new-image-to-a-registry">follow those instructions</a>:<br>1. docker tag myproject/myapp:latest my-registry-host:5000/myproject/myapp:latest <br>2. docker push my-registry-host:5000/myproject/myapp:latest</blockquote><p>There are some guides on the Internet suggesting automating those steps with a script but I don’t like this solution as I want to use the native tooling. A few minutes later I arrived at <a href="https://docs.docker.com/compose/reference/push/">the docker-compose push documentation page</a> which includes a nice example.</p><blockquote>It looks like the image service configuration option follows the same notation as the example above:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5425c7e0877ad49a48f31ca95bdd8c0/href">https://medium.com/media/c5425c7e0877ad49a48f31ca95bdd8c0/href</a></iframe><p>Now when I execute <strong>docker-compose push</strong> my image gets pushed to my private image registry. There is something that still annoys me though — if I decide to change the registry, I need to edit the image configuration option of all described services.</p><blockquote>For this reason I like to extract the registry host as an environment variable:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/712ee1dda40a273c6ac4a4a6756831fa/href">https://medium.com/media/712ee1dda40a273c6ac4a4a6756831fa/href</a></iframe><p>Congratulations! Now you will be able to build and distribute your project’s images by only using the native tooling provided by Docker and Docker Compose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2797097751" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self-hosting a mail server in 2019]]></title>
            <link>https://medium.com/@stoyanov.veseline/self-hosting-a-mail-server-in-2019-6d29542dadd4?source=rss-7f155c51f1fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d29542dadd4</guid>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[smtp]]></category>
            <category><![CDATA[mail-server]]></category>
            <category><![CDATA[self-hosted]]></category>
            <dc:creator><![CDATA[Veselin Stoyanov]]></dc:creator>
            <pubDate>Sun, 24 Feb 2019 17:11:14 GMT</pubDate>
            <atom:updated>2019-02-24T17:11:14.449Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hqQ-rCeU1GwWh0yf" /><figcaption>Photo by <a href="https://unsplash.com/@samuelzeller?utm_source=medium&amp;utm_medium=referral">Samuel Zeller</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>You have some sort of application that has to deliver email. You are also a tech savvy person who believes in the “email is decentralised” mantra so you decide to self-host a mail server yourself. Not so fast. In the following paragraphs I will try to summarise what I have learnt and what it is like to self-host a mail server in 2019.</p><p>It all started a month ago when I launched a small community-driven tech newsletter. The newsletter application consisted of a simple static website and a simple backend for dealing with subscriptions and email deliveries. Deploying to production I had to configure the application’s SMTP settings so I googled about the most recent trends.</p><p>Almost every article I read stated:</p><blockquote>Self-hosting a mail server is hard, better use some Cloud/SaaS solution.</blockquote><p>Why is it hard though? No arguments on that. I decided to give it a shot.</p><p>After a short research I started a Postfix instance in a docker container. A few hours later I successfully configured my domain to work with the SMTP server and sent a test email. It arrived in the SPAM folder of my Gmail account.</p><blockquote>Lesson #1: Running your own mail server is easy. What is hard is to configure it correctly.</blockquote><p>The first thing I instantly noticed was that my email was delivered unencrypted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*xz5ooa6u2NARhjoSo9d_uw.png" /><figcaption>Gmail warns me that the email was not encrypted.</figcaption></figure><p>I quickly fixed that with a certificate provided by Let’s Encrypt. There are a lot of step-by-step tutorials on the topic. Now my emails are encrypted but are still classified as Spam.</p><p>I decided to quit the guesswork and a few minutes later I arrived at <a href="https://support.google.com/mail/answer/81126?hl=en">this helpful page</a>. Here is a quick checklist of what you need to do in order to pass the Spam classification when delivering to Gmail:</p><ol><li>Static IP</li><li>Reverse DNS on your IP address that points to the domain you use for sending emails</li><li>DKIM</li><li>SPF</li><li>DMARC</li><li>Confirmation email before adding to subscription list</li><li>Unsubscribe link</li></ol><p>1, 6, 7 were already done on my side. I continued with the configuration of my mail server with DKIM, SPF and DMARC. Apart from the DNS records there is also a decent amount of configuration that has to be done on the server-side.</p><blockquote>Lesson #2: A usable mail server needs a carefully designed architecture, maintenance and continuous awareness of the most recent security and content practices.</blockquote><p>At this point I decided to check for some community driven mail server (architecture) projects because it requires a lot of knowledge and effort to run a usable mail server. My requirements were the following:</p><ol><li>Dockerized</li><li>Popular and regularly maintained</li><li>Well-documented</li><li>Easy to setup</li></ol><p>I quickly arrived at the following solutions:</p><ol><li><a href="https://mailinabox.email/">Mail-in-a-Box</a> — it isn’t Dockerized and you need a dedicated server or VM in order not to pollute your environment with whatnot. It might be easy to run in a custom docker container but I prefer an officially supported solution.</li><li><a href="https://mailu.io/">Mailu</a> — it is Dockerized and well-documented but in my opinion not easy to setup. I expect a docker-compose up to be enough so I can check up a demo of the project. After some issues with networking and certificates I decided to move on.</li><li><a href="https://mailcow.email/">Mailcow</a> — Dockerized, popular, well-documented and easy to install. I managed to get up and running in less than 30 minutes. The project provides a neat admin UI, as well as a nice looking mailboxes for your domain accounts. Mailcow also guided me how to correctly setup my DNS records. It is just awesome! (P.S. I’m not affiliated in any way with Mailcow)</li></ol><p>I was ready to send another test email. Fingers crossed — BOOM! My email arrived at the Spam folder once again. The only thing I hadn’t done from the checklist was the Reverse DNS. My ISP refused to add a Reverse DNS record to my IP address that points to my domain. I was compliant with everything but this and there was nothing I could do about it.</p><blockquote>At this point I decided to follow the recommendation to just use some cloud mail delivery service.</blockquote><p>All of them offer a “Free” plan which pretty much is more than enough for any small project. You can start delivering emails in 10 minutes and hurray — they arrive at the Primary folder of your mailbox. Those companies make the hassle of running your own mail server look silly and not worth it. Keep in mind however that you may need to update your application’s Terms of Use and/or Privacy Policy because you are sharing people’s personal data with a third-party service. Also although you are using a “Free” plan you cannot start to deliver with most of the services before providing your debit/credit card details.</p><p>I checked out the most popular services and decided to give Amazon SES a try. It worked perfectly. However I quickly realised that I need to use their other cloud services in order to be able not only to send but also to receive emails.</p><blockquote>Lesson #3: Even paid mail transport services have downsides which you need to consider.</blockquote><p>I continued digging the self-hosted mail server topic. Let’s assume you even have a Reverse DNS record setup on your IP address. Is there anything else that can stop you? Yes — there is :). Your IP address might be included in one or more Spam blacklists which many email providers take into account when assessing your emails. Most of them incorporate a process for unbanning IP addresses but this might take some time and communication.</p><p>Other things to keep in mind when self-hosting a mail server:</p><ul><li><strong>Your mail server’s IP address is ALWAYS exposed and you cannot do anything about it.</strong> This is the way emails work. If you host you application on the same server even behind Cloudflare or other proxy, you can easily become a victim of a DoS/DDoS attack.</li><li>Setting up a Spam filter on your mail server can prevent malicious uses of your MTA which can result in your IP address being blacklisted.</li></ul><blockquote>Final lesson: Mail servers are stable. Once you go through all the hassle, you can relax and enjoy your setup.</blockquote><p>In conclusion my personal feeling about self-hosting a mail server is positive. Setting up a self-hosted mail server for a volume of a few hundred emails a month is not only an overhead but also will cost more than using some mail service provider. However for big volumes I would definitely walk the extra mile with the self-hosting way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d29542dadd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>