Skip to content

Read it before you build it

A Dockerfile and a compose file an agent wrote for a stated service. Both build. Both run. Say what it rebuilds, what it weighs, what is inside it that should not be, and what it does when it is asked to stop — and only then build it.

Dockerfile

FROM node:24
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run build
EXPOSE 8080
CMD node src/server.js

compose.yaml

services:
  api:
    build: .
    ports:
      - "8080:8080"
    environment:
      DATABASE_URL: postgres://shop:hunter2@db:5432/shop
    volumes:
      - ./src:/app/src
  db:
    image: postgres:17
    environment:
      POSTGRES_PASSWORD: hunter2

Read, never run. This gym stops at a container and a compose file — orchestration is deploy.liter8.sh.

Before you build

An agent was asked to containerise an existing Node service and produce a compose file for it. Both build and both run. Read them before you build them.

The edit the rebuild question is about: a commit that edits src/routes.js.

  • A commit edits one source file. How many instructions run again?

  • Roughly what does the image weigh, modelled?

  • Does the final image contain a build toolchain it does not need to run?

  • The orchestrator sends SIGTERM. What happens?