# How to deploy a Docker app with your own Dockerfile.

URL: https://antideploy.com/blog/how-to-deploy-a-docker-app-with-your-own-dockerfile

If there is a Dockerfile at the root of your project, Antideploy builds with it and uses its own start command.

## At a glance

- **At the root**: The only place Antideploy builds from
- **EXPOSE and PORT**: The port you declare receives traffic
- **Your CMD**: Your own start command is used
- **Two limits**: An age rule, and no BuildKit features yet

Published 7 October 2026. Facts checked 7 October 2026. 3 min read.

## The short answer

To deploy with your own Dockerfile, put it at the root of your project and give your coding agent the sentence below. Antideploy builds the image from your Dockerfile and runs its `CMD` or `ENTRYPOINT`. Traffic goes to the port you declare with `EXPOSE`, and Antideploy sets `PORT` to match. A Dockerfile is the way to run PHP, and the way to add system programs.

> **Say this to your coding agent**
>
> Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.

## What Antideploy does with a Dockerfile

- **It must be at the root.** A Dockerfile in a subfolder cannot be used. Antideploy warns you and tries to detect the project itself. Move it to the root, or point the build at the folder it sits in.
- **Your start command is used.** The `CMD` or `ENTRYPOINT` in the file is the start command. Antideploy does not add its own beside it.
- **The port comes from `EXPOSE`.** The first `EXPOSE` line sets the port that receives traffic. Without one, Antideploy uses its default for the language. It sets `PORT` to the same number, so read it in your code.
- **The build is yours.** Your install and build steps are in the file. Antideploy does not run the buildpack steps.

## A Dockerfile that works

**Dockerfile**

```
FROM node:22-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "server.js"]
```

Your app inside the container must listen on `0.0.0.0` and on the port you expose. Read `PORT` from the environment so the two always match.

## The two limits

- **The account rule.** A custom Dockerfile builds from the first deploy for accounts signed in with GitHub or Google and on any paid plan. An account made with only an email address waits 7 days. While it waits, a project Antideploy recognises is built without its Dockerfile, and the deploy says so.
- **No BuildKit features yet.** A step such as `RUN --mount=type=cache` needs BuildKit, which the builder does not have enabled. Your Dockerfile is fine. Removing the `--mount=type=cache` lines builds immediately.

## When you need a Dockerfile

- Your app needs a system program, such as `ffmpeg` or an image library
- Your project is PHP, which runs only through a Dockerfile
- You need an exact runtime version or build steps that the automatic build would not choose
- You already have a Dockerfile that works elsewhere

If you do not have these needs, you can skip the Dockerfile. [Do I need Docker, Kubernetes or YAML?](https://antideploy.com/blog/do-i-need-docker-kubernetes-or-yaml-to-deploy) explains why.

## Step by step

### 1. Put the Dockerfile at the root

It sits next to your `package.json`, `requirements.txt` or `go.mod`.

### 2. Paste the sentence and approve one link

Your agent creates the app and deploys it.

### 3. Deploy and open the link

Antideploy builds the image with your Dockerfile, starts the container and checks that it answers on the exposed port. If it never listens, the deploy fails and shows what the app printed.

## Common problems

- **The Dockerfile is empty.** The build says "file with no instructions". Add the instructions, or delete the file and let Antideploy build the project.
- **A step fails with an exit code.** The deploy names the failing step and the exit code. Run the same step locally to see why.
- **The app never starts listening.** It listens on `127.0.0.1` or on a port that does not match `EXPOSE`. See [never started listening](https://antideploy.com/blog/your-app-built-successfully-but-never-started-listening-on-its-port).

## Here's where it stops.

A platform that only tells you what it is good at is one you find the edges of in production. These are the ones to know before your first deploy.

### A Dockerfile has an age gate

A custom Dockerfile builds from the first deploy for accounts signed in with GitHub or Google and on any paid plan. An account made with only an email address waits 7 days.

### Apps sleep when idle

On every plan, an app nobody is using goes to sleep and the next visit wakes it. The first request took 2.9 to 13.9 seconds in our measurements, depending on the stack. There are no always-on workers, so use a cron job or a webhook for background work.

### One instance, no previews

Each app is one instance with 1 shared vCPU and 1 GB of memory, and a Java app gets 1 dedicated vCPU and 2 GB. There are no preview deployments and no per-branch URLs.

### The disk forgets

Anything written to local disk is gone on the next deploy. Apps that speak S3 get a bucket instead.

## Dockerfile questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto:support@antideploy.com)

### Which Docker features are supported?

Standard Dockerfile steps work, including `COPY`, `RUN`, `ENV`, `EXPOSE` and `CMD`. Features that need BuildKit, such as `RUN --mount`, are not supported yet.

### How long can a build take?

Builds are given 20 minutes. A build that runs longer is stopped, and the deploy says so.

### Can I use docker-compose?

Antideploy builds one container from the Dockerfile at the root. It runs one app per project.

### Does my Dockerfile count against my plan?

No. The app counts as a live app, like any app with a server.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [Do I need Docker, Kubernetes or YAML to deploy?](https://antideploy.com/blog/do-i-need-docker-kubernetes-or-yaml-to-deploy): No. What each one is, why one app does not need them, and when a Dockerfile is still worth it.
- [How to deploy a Go app](https://antideploy.com/blog/how-to-deploy-a-go-app): go.mod, the built binary, the PORT variable, Postgres and the go.sum fix.
- [Your app built successfully but never started listening on its port](https://antideploy.com/blog/your-app-built-successfully-but-never-started-listening-on-its-port): The app built but never answered on its port. Read PORT, listen on 0.0.0.0 and check the logs.

- [Hosting](https://antideploy.com/platform/hosting)
- [Deployments](https://antideploy.com/platform/deployments)
- [Environment variables](https://antideploy.com/platform/environment-variables)

Facts on this page were checked against the live platform on 7 October 2026.

## Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
