Next up on our data stack journey is the push notification server. I’ll be using multiple notification channels, hoping that I’ll pay attention to at least one when something critical goes down. Alerting is a key piece of analytics infrastructure for me—data should come to you, not the other way around.

So, what are doing here?

We’re bridging the gap between the data stack and the real world by setting up a notification system to deliver push notifications straight to my phone. Once my Airflow server is up and running, I’ll create a custom function to send alerts using this server.

Okay, how?

Enter Gotify: https://gotify.net/

Gotify describes itself as “a simple server for sending and receiving messages.” Perfect, because that’s exactly what we need.

Why Gotify?

It’s licesned under MIT and i can throw it onto my webserver to expose a websocket. So it’s free. It’s got a REST API So i think it will be easy to integrate it into airflow with teh requests library.

You’re going to talk about docker again aren’t you.

By now, you might’ve guessed: I love Docker. Infrastructure as code makes everything so much easier. Without it, I wouldn’t even attempt a project like this.

Well get on with it.

Here we go! Gotify has a docker-compose.yaml file in their docs:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
version: "3"

services:
  gotify:
    image: gotify/server
    ports:
      - 8080:80
    environment:
      - GOTIFY_DEFAULTUSER_PASS=custom
    volumes:
      - "./gotify_data:/app/data"

To enhance security and tailor it to my setup, I modified the configuration. Specifically, I added an external network and restricted privilege escalation.

Here’s my updated docker-compose.yml:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
version: "3"

services:
  gotify:
    image: gotify/server
    security_opt:
      - no-new-privileges:true
    ports:
      - 8080:80
    environment:
      - GOTIFY_DEFAULTUSER_PASS=custom
    volumes:
      - "./gotify_data:/app/data"
    networks:
      my-external-network:

networks:
  my-external-network:
    external: true

Let’s fire it up:

1
docker compose up

No errors and I can I see it!

Gotify Login Page

Okay now what?

While I won’t dive into every detail, here’s the roadmap I followed to finish setting up Gotify:

  1. DNS and Proxy Setup: Redirected traffic to Gotify. ✅
  2. Connect to the Web: Ensured the server was accessible externally. ✅
  3. Install the Android App: Play Store link ✅
  4. Create an Application: Generated an API key on the Gotify server. ✅
  5. Test Notifications: Fired off a test message to confirm delivery. ✅

Now, I’m receiving push notifications from my data stack directly to my phone. Success!

Gotify Iceburg Meme