Skip to content

Field notes · AI

An AI Agent Wrote Your Docker Compose File. Five Checks Before You Run It

Render a compose file with docker compose config before you start it. Catch open ports, floating tags, inline passwords, and missing volumes.

Table of Contents
A row of five plain tiles joined by lines, labeled render, ports, images, secrets and volumes. The first tile is marked with an orange bar and the words the starting check. A small status row under the first tiles reads exit 15, then host_ip blank. exit 15 is the render failure from a bad service name. host_ip is the address a published port listens on. An empty host_ip means the port is open on every interface. Headline: Render the compose file before you start it.

A field note for Fri, Dec 4, 2026. The commands and output below come from a throwaway debian:trixie-slim containerA lightweight, portable package that bundles an application with its dependencies and runs in an isolated process on the host OS, sharing the kernel. Read more → on bn-dev, our build server, between 5:34 and 5:35 AM ET. This was a static render of a Compose file. Nothing was started, and no ports were published.

The short version

If you use ChatGPT, Claude, Grok Bot, or any other agent to help set up a home server, it will hand you a DockerA platform that packages applications into containers, providing a standardized way to build, ship, and run software consistently across any environment. Read more → Compose file. The file often starts. That is not the same as being safe to leave running.

An agent’s first draft tends to publish the database to the whole network, use a floating image tag, paste the password into the file, and forget where the data lives. You can catch all of that before anything starts. Render the file with docker compose config and read the plan it will actually use.

Think of it as a contractor’s plans. A helper drew them fast and they look fine. Before anyone pours concrete, you read the stamped set, not the napkin sketch, and you check where the doors open to.

The draft in this note was written by Grok Bot, on BytesNation’s research desk, as a typical first draft with five planted issues. It is not a file copied from a reader’s chat. The checks are the same ones you would run on a file an agent handed you.

Jan-Lukas Else, writing about how agents have made self-hosting fun again, put it plainly: having an AI agentAn AI system that can autonomously plan, execute multi-step tasks, use tools, and make decisions to accomplish a goal with minimal human guidance. Read more → make changes to his infrastructure “doesn’t absolve me of the responsibility of understanding those changes.” His postPower-On Self-Test: the quick hardware check firmware runs every time a computer starts, before it looks for an operating system. Read more → sat at 1,181 points and 559 comments on Hacker News as of early Friday morning, Dec 4, 2026. The habit below is how you do that reading on a Compose file.

Why a file that starts can still be a problem

A Compose file is a YAMLA human-readable data format used for configuration files, favored for its clean syntax with indentation instead of brackets and braces. Read more → description of several containers that should run together. docker compose config fills in variables, applies defaults, and expands short syntax into the long form. The config command documentation calls this rendering the actual data model that will be applied. You review that output, not only the source file you were handed.

On this run the command came from Debian 13’s docker-compose package, which reported Docker Compose version 2.26.1-4. The current Docker CLI spelling is docker compose. The config subcommand is the same, and it does not need a running Docker daemon.

A published port makes a container reachable from outside the machine. Short lines such as "8080:8080" and "5432:5432" look tidy. After render, both showed host_ip=''. The Compose specification says that when host_ip is not set, the portA numbered endpoint on a device that identifies a specific application or service, allowing multiple network services to run on the same IP address. Read more → binds all network interfaces, which is 0.0.0.0. Your database is then reachable from every device that can reach the host, not only from the app sitting next to it on the Compose network.

Five checks, in this order

The same chain of five tiles, render, ports, images, secrets and volumes, with an orange bar under render labeled the starting check. A status row under the first tiles reads exit 15, then host_ip blank. exit 15 is the render failure from a bad service name. An empty host_ip means the port is open on every interface.

Work through the rendered file in this order. Each check has its own signal, so read the exact output before you change anything else.

  1. Does the file render at all?
  2. Where do the published ports listen?
  3. Which image tags will be pulled?
  4. Do secrets appear in the rendered file?
  5. Is there a named volume for the data?

The first check on bn-dev failed immediately. The app service depended on a service named database, but the database service was named db.

$ docker-compose config
service "app" depends on undefined service "database": invalid compose project
exit=15

After that reference was pointed at db, the same command rendered the file and exited 0. Then the ports:

$ docker-compose config --format json | ports
app host_ip='' published=8080 target=8080
db host_ip='' published=5432 target=5432

Captured on bn-dev, Dec 4, 2026, 5:34 to 5:35 AM ET, debian:trixie-slim in a throwaway —rm container. Docker Compose 2.26.1-4, from the Debian 13 package. Static checks only. Nothing was started, and no miniflux or postgres images were pulled.

The | ports line is the label the capture script printed above a short JSON filter. The numbers are the rendered values.

docker-compose config --images printed miniflux/miniflux:latest and postgres. An untagged postgres means latest, and latest moves under you. The password hunter2, a fake value used in the draft, appeared twice in the rendered file, once on the DATABASE_URL line and once on POSTGRES_PASSWORD. docker-compose config --volumes printed nothing and exited 0. There was no named volume, so the database had nowhere durable to live.

The fixed file pinned the app to miniflux/miniflux:2.2.6, a tag confirmed on Docker Hub today, and the database to postgres:17. The app port became "127.0.0.1:8080:8080". The database publish was removed. The app can still reach the database on the Compose network by the service name db. The password was replaced with ${DB_PASSWORD:?set DB_PASSWORD in .env}, which Compose interpolation treats as a hard requirement. If the variable is unset or empty, render fails. A named volume, dbdata, was mounted at /var/lib/postgresql/data.

Rendered with no .env, config printed error while interpolating services.app.environment.DATABASE_URL: required variable DB_PASSWORD is missing a value: set DB_PASSWORD in .env and exited 15. After a placeholder was written to .env, the ports line was app host_ip='127.0.0.1' published=8080 target=8080. The image list was miniflux/miniflux:2.2.6 and postgres:17. --volumes printed dbdata. The placeholder password still appeared in the rendered output, on lines 9 and 22. config is not a redacting tool. Do not paste that output into a forum, an issue, or a chat with an agent.

config also does not check that a tag exists in a registry, or that an environment variable name is one the app actually reads. Invented names and stale tags still need the app’s own docs.

What this did not cover

This run never started the stack. It did not run docker compose up, did not use ss -tlnp to show a live listen address, did not check that a volume survives docker compose down, and did not demonstrate Docker’s published-port bypass of host firewall rules such as ufw. Those are useful reader steps. They need a running daemon and published ports, which this capture did not include, so this note does not claim output for them.

Your first step

Take the last Compose file you did not write yourself. Run docker compose config, then docker compose config --images and docker compose config --volumes, and read the ports lines. If a service depends on a name that does not exist, you will get a hard error before anything starts. If host_ip is empty, that port is on all interfaces. If you see :latest or a bare image name, pin a version you have read. If a password is in the output, move it out of the file. If --volumes is empty and the app stores data, add a named volume before you treat the stack as durable.

The note on what’s inside an agent skill from Nov 25 is the neighboring habit: read what you are about to run. The Authelia and Caddy note made a similar point about published ports, where the app port was a way around the SSO layer.

Go deeper: the draft and the fix, Postgres 18 volumes, and published ports versus ufw

The diff from the bn-dev capture. The block below is verbatim, including the /lab/draft and /lab/fixed paths and the UTC timestamps from the container. The depends_on typo had already been corrected to db in the draft used for this diff, so the remaining changes are the four fixes that made the file safer to leave running: a pinned tag, a localhost bind, a required variable instead of an inline password, no published database port, and a named volume.

--- /lab/draft/compose.yaml	2026-12-04 10:35:17.865895768 +0000
+++ /lab/fixed/compose.yaml	2026-12-04 10:35:18.014439144 +0000
@@ -1,17 +1,19 @@
 services:
   app:
-    image: miniflux/miniflux:latest
+    image: miniflux/miniflux:2.2.6
     ports:
-      - "8080:8080"
+      - "127.0.0.1:8080:8080"
     environment:
-      DATABASE_URL: postgres://miniflux:hunter2@db/miniflux?sslmode=disable
+      DATABASE_URL: postgres://miniflux:${DB_PASSWORD:?set DB_PASSWORD in .env}@db/miniflux?sslmode=disable
       RUN_MIGRATIONS: "1"
     depends_on:
       - db
   db:
-    image: postgres
-    ports:
-      - "5432:5432"
+    image: postgres:17
     environment:
       POSTGRES_USER: miniflux
-      POSTGRES_PASSWORD: hunter2
+      POSTGRES_PASSWORD: ${DB_PASSWORD:?set DB_PASSWORD in .env}
+    volumes:
+      - dbdata:/var/lib/postgresql/data
+volumes:
+  dbdata:

The required-variable error, then the fixed render. With no .env, Compose refused to interpolate and exited 15. After DB_PASSWORD=example-only-change-me was written to .env, the same checks printed the localhost bind, the pinned images, the named volume, and, still in plain text, the placeholder password.

$ docker-compose config
error while interpolating services.app.environment.DATABASE_URL: required variable DB_PASSWORD is missing a value: set DB_PASSWORD in .env
exit=15

$ docker-compose config --format json | ports
app host_ip='127.0.0.1' published=8080 target=8080
$ docker-compose config --images
miniflux/miniflux:2.2.6
postgres:17
$ docker-compose config --volumes
dbdata
$ docker-compose config | grep -n example-only
9:      DATABASE_URL: postgres://miniflux:example-only-change-me@db/miniflux?sslmode=disable
22:      POSTGRES_PASSWORD: example-only-change-me

Those lines are from the same bn-dev capture, with the script’s section labels dropped.

Postgres 18 and the classic data path. The official Docker postgres image docs say the PGDATA environment variable became version specific in PostgreSQL 18 and above. For 18 it is /var/lib/postgresql/18/docker, and later majors replace 18 with their own number. The defined VOLUME moved to /var/lib/postgresql. The change landed in docker-library/postgres pull request 1259. An untagged postgres image plus the classic /var/lib/postgresql/data mount is an upgrade trap: when latest becomes 18, that old path is no longer where the image keeps the data. The fixed file in this note pins postgres:17 and keeps the classic path, which is still the documented mount for 17 and below. Pin a major, or a digest, before you treat the volume as settled. A tool such as Renovate can propose bumps; you still read them. Jan-Lukas Else describes that review-and-merge loop in the same post.

Published ports and ufw. Docker’s packet filtering and firewalls page says Docker and ufw use firewall rules in ways that make them incompatible. Traffic to a published port is diverted before it reaches the INPUT and OUTPUT chains that ufw uses, “effectively ignoring your firewall configuration.” This capture did not start a stack or test ufw, so treat that as a documentation warning and a reader check, not a result from bn-dev. Binding the app to 127.0.0.1, and not publishing the database at all, shrinks what that warning can touch. The database almost never needs a published port. The app reaches it on the Compose network by service name.

What to ask the agent for. After it writes or edits a Compose file, ask for a diff against the previous version and a documentation link for each setting it added or changed. config will catch a broken service reference. It will not catch an invented environment variable or a tag that does not exist yet.

Sources: Jan-Lukas Else, “AI made self-hosting fun again”, Nov 26, 2026; Hacker News item 50660180, 1,181 points and 559 comments as of early Friday morning, Dec 4, 2026, confirmed via the HN API; docker compose config; Compose interpolation; Compose specification, ports long syntax; Packet filtering and firewalls; Docker official postgres image docs; postgres pull request 1259. Image tag miniflux/miniflux:2.2.6 was present on the Docker Hub tag API on Dec 4, 2026. Package version is from the capture: Docker Compose 2.26.1-4, Debian GNU/Linux 13 (trixie), debian:trixie-slim in a throwaway --rm container.

aidockercomposeself-hostingtroubleshootingagentsbeginners

All field notes