DockHosting Docs
Deploying

Docker

Deploy any Dockerfile — multi-stage builds, custom base images, and build args.

If your repository has a Dockerfile at its root, DockHosting builds and runs it as-is. No platform-specific config, no build detection guessing — docker build against your repo, then the resulting image is what runs.

Requirements

  • A Dockerfile in the repository root (or a custom path — configurable in your project's settings)
  • The Dockerfile must EXPOSE the port your app listens on, and your app must bind to 0.0.0.0, not 127.0.0.1 — a container that only listens on localhost is unreachable from outside itself
  • Read the port from the PORT environment variable if your app supports it; DockHosting sets it for you

What's supported

  • Multi-stage builds
  • Any public base image, or a private registry image if you've configured registry credentials
  • Build arguments (ARG / --build-arg, set from your project's environment variables)
  • docker-compose.yml for local development — DockHosting only builds the single Dockerfile you point it at, it does not orchestrate multiple services from a compose file

Common build failures

These are the errors that actually show up most often for Docker deploys — worth checking before anything else.

COPY failed: file not found in build context or excluded by .dockerignore

The file your COPY instruction references isn't where the build expects it. Two usual causes:

  • The path is wrong relative to the build context (the directory containing your Dockerfile, not the directory you happen to be in when you run a local build)
  • The file is listed in .dockerignore and got excluded — check that file for an overly broad pattern like *.json or node_modules that's also catching something you need

COPY failed: no source files were specified

The COPY instruction has an empty or malformed source argument — often from a build arg or variable substitution that resolved to nothing. Check any ARG-driven COPY lines.

pull access denied for <image>, repository does not exist

Either the base image name is misspelled, or it's a private image and no registry credentials are configured for this project. Public images (node:20-slim, php:8.3-fpm, etc.) don't need credentials; anything under a private namespace does.

Private networking and databases

A container built from your Dockerfile gets the same private network access as any other deploy — attach a database and its connection string lands in your container's environment automatically, no extra Docker networking config required on your end.

On this page