About
Tool No. 63 of Pikkola
A Dockerfile is a short file with a long reach. The order of its lines decides how long a rebuild takes, how much of the compiler ends up in production, and which user the process runs as. This page writes that order for a stack you pick, and reads an existing file to say where the order was broken.
What it does
- Writes a Dockerfile for Node.js, Next.js, Python with FastAPI, Go, Rust, or a static site served by Nginx.
- Splits the build into stages, adds a non-root user, a HEALTHCHECK tuned to the runtime and BuildKit cache mounts, each on a switch.
- Writes the .dockerignore that belongs to the same stack, with the build output, the dependencies and the environment files kept out of the context.
- Writes a docker-compose.yml with the app plus PostgreSQL, Redis and an Nginx proxy, health checks, a health condition on depends_on and named volumes.
- Writes the nginx.conf that the proxy service mounts, so the second file is not left as an exercise.
- Audits a pasted Dockerfile: base tags, the user, apt lists, layer cache order, secrets in ENV and ARG, ADD, ADD-style downloads, unfinished files.
- Copies or downloads every result. Nothing is uploaded, stored or sent.
The three benches
The Dockerfile bench is a function per stack. Each one knows the base image, the manifest files, the install command and the path the process starts from, and each one has a single-stage and a multi-stage shape. The switches do not edit the text afterwards; they are arguments to the function, so a file is never assembled from fragments that disagree with each other.
The compose bench is the same idea around a service graph. The app is always the service that builds from the file next door. PostgreSQL, Redis and the proxy are added in a fixed order, because the order in a compose file is also the order a reader meets it. A health check is copied into the compose file for the app in the form the runtime can actually run: a node one-liner for Node, an urllib call for Python, wget for Alpine, curl where curl was installed.
The audit bench joins continuation lines into one instruction before reading, because Docker does. A RUN that installs packages across four lines is one instruction with one line number, and a COPY that appears before it is a cache problem no matter how the newlines fall.
Why the order is what it is
Every instruction is a cache key over the files it touches. COPY package.json and the install that follows are stable as long as the lockfile is, so a source edit stops at the next instruction instead of running everything again. That is the whole reason the manifest is copied first, and the whole reason the audit treats COPY . . before the install as a finding rather than a style note.
The last stage holds only what runs. For Node that is the production dependency tree and the build output; for Go a static binary on Alpine; for Rust the target binary on Debian with the CA certificates it needs. The compiler, the headers and the source stay in the stage that needed them, and an image that is 80 MB instead of 900 MB is a smaller thing to patch.
Where the limits are
- It writes a starting file, not a verified build. The paths it names are the conventions of each stack, and your project may name them differently.
- The base images are the current versioned tags as of November 2026. They will age; the point of a version tag is that you move it deliberately.
- The audit reads the file, not the build. It cannot know whether the process really starts, which port the network reaches, or what your .dockerignore leaves out.
- Secrets are found by name and by a literal value in ENV or ARG. A secret baked into a file that COPY brings in is outside what a text read can see.
- The compose file is not validated against the compose schema. It is written in a shape that file parses, and the app still needs its own environment.
- Nothing is fetched: no registry, no image manifest, no compose schema, no font or script from another domain.
Why it is free
Pikkola builds small tools with one job each and keeps them free, with no account and no lock on the result. A static page that works in the browser costs almost nothing to serve, so there is no reason to charge for it or to watch who uses it.
Contact
A Dockerfile this page writes in a way your stack cannot use, a finding that is wrong, a Korean or Japanese sentence that reads badly: hello@pikkola.com. The file itself and the line you disagree with are the most useful things to send.
소개
피콜라 63호기
Dockerfile은 짧은데 영향은 깁니다. 줄의 순서가 재빌드에 걸리는 시간, 실행 이미지에 남는 컴파일러의 양, 프로세스가 어떤 사용자로 도는지를 다 정합니다. 이 페이지는 고른 스택에 맞춰 그 순서를 쓰고, 이미 있는 파일을 읽어 어디서 순서가 깨졌는지 말합니다.
하는 일
- Node.js, Next.js, FastAPI를 쓰는 Python, Go, Rust, Nginx로 서빙하는 정적 사이트의 Dockerfile을 씁니다.
- 빌드를 단계로 나누고, non-root 사용자와 런타임에 맞춘 HEALTHCHECK와 BuildKit 캐시 마운트를 넣습니다. 각각 스위치로 끌 수 있습니다.
- 같은 스택에 맞는 .dockerignore를 씁니다. 빌드 산출물, 의존성, 환경 파일을 빌드 컨텍스트에서 뺍니다.
- 앱과 PostgreSQL, Redis, Nginx 프록시를 담은 docker-compose.yml을 씁니다. 헬스체크와 depends_on의 헬스 조건, 이름 있는 볼륨까지 넣습니다.
- 프록시 서비스가 마운트하는 nginx.conf도 씁니다. 두 번째 파일을 숙제로 남기지 않으려고요.
- 붙여 넣은 Dockerfile을 감사합니다. 베이스 태그, 사용자, apt 목록, 레이어 캐시 순서, ENV와 ARG의 시크릿, ADD, 내려받아 실행하는 줄, 끝나지 않은 파일을 봅니다.
- 결과는 복사하거나 내려받습니다. 올리거나 저장하거나 보내는 것은 없습니다.
작업대 셋
Dockerfile 작업대는 스택마다 함수 하나입니다. 각 함수는 베이스 이미지와 매니페스트 파일, 설치 명령, 프로세스가 시작하는 경로를 알고 있고, 단일 단계와 멀티스테이지 두 가지 모양을 가집니다. 스위치는 글자를 나중에 고치지 않고 함수의 인자로 들어가므로, 서로 어긋난 조각을 이어 붙인 파일이 나올 수 없습니다.
compose 작업대는 같은 생각을 서비스 그래프에 씁니다. 앱은 늘 옆 파일로 빌드하는 서비스입니다. PostgreSQL, Redis, 프록시는 정해진 순서로 붙고, 그 순서는 compose 파일을 읽는 사람이 만나는 순서이기도 합니다. 앱의 헬스체크는 런타임이 실제로 돌릴 수 있는 모양으로 들어갑니다. Node에는 node 한 줄, Python에는 urllib 호출, Alpine에는 wget, curl을 설치한 이미지에는 curl입니다.
감사 작업대는 이어지는 줄을 하나의 지시문으로 붙여서 읽습니다. 도커가 그러기 때문입니다. 네 줄에 걸쳐 패키지를 설치하는 RUN은 줄 번호 하나를 가진 지시문 하나이고, 그 앞에 있는 COPY는 줄바꿈이 어떻게 놓였든 캐시 문제입니다.
이 순서인 이유
지시문마다 자기가 건드리는 파일에 대한 캐시 키입니다. package.json을 복사하고 이어서 설치하는 부분은 잠금 파일이 그대로인 한 안정적이라, 소스를 고쳐도 다음 지시문에서 멈추고 전부를 다시 돌지 않습니다. 매니페스트를 먼저 복사하는 이유가 이것이고, 감사가 설치 전의 COPY . .를 취향이 아니라 지적으로 다루는 이유도 이것입니다.
마지막 단계에는 실행에 필요한 것만 남습니다. Node라면 운영 의존성 트리와 빌드 산출물, Go라면 Alpine 위의 정적 바이너리, Rust라면 필요한 CA 인증서를 갖춘 Debian 위의 바이너리입니다. 컴파일러와 헤더와 소스는 그것을 필요로 한 단계에 남고, 900MB가 아니라 80MB인 이미지는 패치할 것도 적습니다.
한계
- 시작 파일을 쓰고, 검증된 빌드를 쓰지는 않습니다. 가리키는 경로는 각 스택의 관례이고, 프로젝트에 따라 이름이 다를 수 있습니다.
- 베이스 이미지는 2026년 11월 기준의 버전 태그입니다. 시간이 지나면 낡습니다. 버전 태그의 요점은 올릴 때 올리려고 올린다는 것입니다.
- 감사는 파일을 읽고 빌드는 읽지 않습니다. 프로세스가 정말 뜨는지, 네트워크가 어느 포트에 닿는지, .dockerignore에서 무엇이 빠졌는지는 알 수 없습니다.
- 시크릿은 ENV나 ARG에서 이름과 실제 값으로 찾습니다. COPY가 가져오는 파일 안에 박힌 시크릿은 글자만 읽어서는 볼 수 없습니다.
- compose 파일을 compose 스키마로 검증하지는 않습니다. 그 파일이 읽는 모양으로 썼고, 앱의 환경값은 여전히 앱 몫입니다.
- 가져오는 것이 없습니다. 레지스트리도, 이미지 매니페스트도, compose 스키마도, 다른 도메인의 글꼴이나 스크립트도 없습니다.
왜 무료인가
피콜라는 한 가지 일만 하는 작은 도구를 만들고 무료로 둡니다. 계정도, 결과에 거는 잠금도 없습니다. 브라우저에서 도는 정적 페이지는 서빙 비용이 거의 없으니, 값을 매길 이유도 누가 쓰는지 지켜볼 이유도 없습니다.
연락
이 페이지가 쓴 Dockerfile을 여러분의 스택이 쓸 수 없다든지, 틀린 지적이 있다든지, 읽기 불편한 한국어나 일본어 문장이 있다든지: hello@pikkola.com. 파일과 동의하지 않는 줄을 보내 주시면 가장 도움이 됩니다.
概要
Pikkola 63号機
Dockerfile は短いのに、届く先は長い。行の順が、再ビルドにかかる時間、実行イメージに残るコンパイラの量、プロセスが動く利用者を決めます。このページは選んだスタックに合わせてその順を書き、すでにあるファイルを読んで順が崩れた場所を伝えます。
できること
- Node.js、Next.js、FastAPI の Python、Go、Rust、Nginx で配る静的サイトの Dockerfile を書きます。
- ビルドを段に分け、non-root ユーザー、実行環境に合わせた HEALTHCHECK、BuildKit のキャッシュマウントを入れます。どれもスイッチで切れます。
- 同じスタックに合う .dockerignore を書きます。ビルド成果物、依存関係、環境ファイルをビルドコンテキストから外します。
- アプリと PostgreSQL、Redis、Nginx プロキシを入れた docker-compose.yml を書きます。ヘルスチェック、depends_on のヘルス条件、名前付きボリュームまで。
- プロキシがマウントする nginx.conf も書きます。二つ目のファイルを宿題にしないためです。
- 貼り付けた Dockerfile を監査します。ベースタグ、利用者、apt の一覧、レイヤキャッシュの順、ENV と ARG の秘密、ADD、落として実行する行、終わっていないファイル。
- 結果はコピーするか保存します。送るものも、保存するものもありません。
三つの作業台
Dockerfile の作業台はスタックごとの関数です。それぞれがベースイメージ、マニフェスト、インストールの命令、プロセスが始まるパスを知っていて、単段と多段の二つの形を持ちます。スイッチは後から文字を直すのではなく関数の引数なので、食い違う断片をつないだファイルはできません。
compose の作業台は同じ考えをサービスのグラフに使います。アプリは常に隣のファイルからビルドするサービスです。PostgreSQL、Redis、プロキシは決まった順に付き、その順は compose ファイルを読む人が出会う順でもあります。アプリのヘルスチェックは、実行環境が実際に動かせる形で入ります。Node には node の一行、Python には urllib の呼び出し、Alpine には wget、curl を入れたイメージには curl です。
監査の作業台は、続く行を一つの命令としてつないでから読みます。Docker がそうするからです。四行にわたってパッケージを入れる RUN は行番号一つを持つ命令一つで、その前の COPY は改行の置き方に関係なくキャッシュの問題です。
この順である理由
命令はそれぞれ、触るファイルに対するキャッシュキーです。package.json を写して続けて入れる部分は、ロックファイルが同じである限り安定なので、ソースを直しても次の命令で止まり、全部をやり直しません。マニフェストを先に写す理由がこれで、監査がインストール前の COPY . . を好みではなく指摘として扱う理由もこれです。
最後の段には実行に要るものだけが残ります。Node なら本番の依存ツリーとビルド成果物、Go なら Alpine 上の静的バイナリ、Rust なら必要な CA 証明書を備えた Debian 上のバイナリです。コンパイラとヘッダとソースはそれを必要とした段に残り、900MB ではなく 80MB のイメージは直すものも少なくなります。
限界
- 出発点のファイルを書き、検証したビルドは書きません。指すパスは各スタックの慣習で、プロジェクトによって名前が違うことがあります。
- ベースイメージは 2026 年 11 月時点の版のタグです。時間とともに古くなります。版のタグの要点は、上げるときに意図して上げることです。
- 監査はファイルを読み、ビルドは読みません。プロセスが本当に起きるか、どのポートに届くか、.dockerignore から何が抜けたかは分かりません。
- 秘密は ENV や ARG で名前と実値から見つけます。COPY が持ち込むファイルに埋まった秘密は、文字を読むだけでは見えません。
- compose ファイルを compose のスキーマで検証はしません。そのファイルが読む形で書き、アプリの環境の値はアプリのままです。
- 取りに行くものがありません。レジストリも、イメージのマニフェストも、compose のスキーマも、別のドメインの書体もスクリプトもありません。
なぜ無料か
Pikkola はひとつの仕事だけをする小さな道具を作り、無料で置きます。アカウントも、結果に掛ける鍵もありません。ブラウザで動く静的なページは配信の費用がほとんどかからないので、値段を付ける理由も、誰が使うかを見張る理由もありません。
連絡
このページが書いた Dockerfile をあなたのスタックが使えない、指摘が違う、読みにくい韓国語や日本語の文がある: hello@pikkola.com。ファイルと、納得できない行を送っていただけると助かります。