EthioDeploy
DocsPricingDomainsBlogToolsChangelog
Tools / Dockerfile generator

Dockerfile generator

Pick your framework and get a Dockerfile that builds small, runs as a non-root user where the framework allows it, and listens on 0.0.0.0 and the PORT your host sets. You also get a .dockerignore, a Procfile and the plain start command.

  • Free
  • No signup
  • Runs in your browser
  • Base images checked 2026-11-24
Framework
Package manager
The file that calls app.listen(), e.g. server.js or dist/index.js.
FROM node:24-slim
WORKDIR /app
ENV NODE_ENV=production
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
COPY . .
# Platforms set PORT; 3000 is the fallback for docker run.
ENV PORT=3000
EXPOSE 3000
USER node
# node directly, not npm start: npm would stay in memory and swallow SIGTERM.
CMD ["node", "server.js"]
Start command
node server.js
In your code
const port = Number(process.env.PORT) || 3000;
app.listen(port, "0.0.0.0", () => console.log(`Listening on ${port}`));
Before you deploy
  • If you compile TypeScript, run the build locally or add a build stage, and point the entry file at the output (dist/index.js).
  • Packages the server imports at runtime must be in dependencies, not devDependencies: this image installs production dependencies only.
EthioDeploy

Or skip the Dockerfile.

EthioDeploy detects Node, Next.js, Python, PHP, Go and Ruby projects and builds them without one. If your repo has a Dockerfile, it builds that instead. Either way you get HTTPS, a database and deploys on every push. Free plan, no card.

How builds work

How to use it

  1. 01

    Pick the framework

    Choose the runtime version and, for Node projects, the package manager your lockfile comes from. The lockfile must be committed.

  2. 02

    Save the files

    Put the Dockerfile and .dockerignore in the project root, plus the Caddyfile for a Vite app. Use the Procfile instead on a buildpack host.

  3. 03

    Build and run it

    docker build -t app . then docker run -e PORT=8080 -p 8080:8080 app, and open localhost:8080. If it works there, it works on any host that sets PORT.

What the Dockerfiles do

Listen on $PORT
Heroku, Render, Railway, Fly.io, Cloud Run and EthioDeploy all tell your app which port to use through PORT. Each Dockerfile sets a fallback for docker run and lets the platform override it.
Small final images
Next.js uses standalone output, Vite ships only the built files on Caddy, and Go ships a static binary on an empty image. Build tools stay in the build stage.
The server is PID 1
Commands start with exec or run the server directly instead of npm start, so the app gets the platform's stop signal and can shut down cleanly.
Official base images
node, python, php, golang, ruby and caddy from Docker Hub's official images, on tags that were current on 2026-11-24. Pin a patch version if you need reproducible builds.
FAQ

Questions

Last updated November 24, 2026

Inside a container, 127.0.0.1 only accepts connections from the container itself. The platform's proxy connects from outside, so a server bound to localhost can't be reached and you get a 502. 0.0.0.0 means every interface.

It's the port the platform expects your app to listen on. Hosts set it at runtime and route traffic there, so read it from the environment instead of hard-coding 3000 or 8000.

No. A Procfile is for buildpack hosts like Heroku that build your app without Docker. With a Dockerfile, the CMD is the start command. Release lines in the Procfile, like migrations, become a pre-deploy command on Docker hosts.

Use the version you develop on. Node 24 is the current LTS line and Node 22 is still supported. Python 3.13 is a safe default; 3.14 works if your dependencies ship wheels for it.

Without output: "standalone", the image needs the whole node_modules. Standalone output traces only the files the server uses, and the generated Dockerfile copies just that folder plus static assets.

The Dockerfiles work on both, but an image built on an M-series Mac is arm64. If you build locally and push the image, add --platform linux/amd64 for an x86 server, or you'll see exec format error. Hosts that build from your repo build for their own CPU.

More free tools

All tools
DeployDeploy error explainerPaste a failing build or runtime log and get the likely cause, the fix and a link to the full guide.Deploy.env validator & converterFind duplicate keys, broken quotes and leaked public secrets, then convert to JSON, YAML, Docker or Compose.HostingHosting cost calculatorMonthly cost of your apps and a database on Heroku, Render, Railway, Vercel, Fly.io and EthioDeploy, from each vendor's pricing page.

Read next: Docker exec format error from an Apple Silicon build · 502 Bad Gateway after deploy

Ship it from GitHub.

EthioDeploy builds and runs your app on every push, with a database and HTTPS. Free plan, no card.

Deploy free
EthioDeploy

Agentic first development and deployment, started in Ethiopia, built for developers everywhere.

Telegram community
Product
PricingAI coding agentAgent mode docsDomainsCLIFree backend hostingHosting in EthiopiaChangelog
Deploy guides
Next.jsNode.jsPythonSvelteKitTanStack StartAstroNuxtReact RouterHonoStrapiPayload CMSDjangoFastAPIFlaskStreamlitExpressNestJSLaravelRailsGoSpring BootASP.NET CoreTelegram botDiscord botWhatsApp botLovableBoltReplitv0Google AI StudioBase44Firebase StudioClaude Code & Cursor
Compare
vs Herokuvs Vercelvs Rendervs Railwayvs Fly.iovs Netlifyvs KoyebHeroku alternativesVercel alternativesNetlify alternativesRender alternativesRailway alternativesFly.io alternativesReplit alternativesPythonAnywhere alternativesDigitalOcean App Platform alternativesGlitch alternatives
Resources
DocsBlogFree toolsAboutSupportContactllms.txt
© 2026 EthioDeployPay by card in USD or bank transfer in ETBTermsPrivacy