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
CMDorENTRYPOINTin the file is the start command. Antideploy does not add its own beside it. -
The port comes from
EXPOSE. The firstEXPOSEline sets the port that receives traffic. Without one, Antideploy uses its default for the language. It setsPORTto 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
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=cacheneeds BuildKit, which the builder does not have enabled. Your Dockerfile is fine. Removing the--mount=type=cachelines builds immediately.
When you need a Dockerfile
- Your app needs a system program, such as
ffmpegor 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? explains why.
Step by step
-
Put the Dockerfile at the root
It sits next to your
package.json,requirements.txtorgo.mod. -
Paste the sentence and approve one link
Your agent creates the app and deploys it.
-
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.1or on a port that does not matchEXPOSE. See never started listening.