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
Dockerfilein the repository root (or a custom path — configurable in your project's settings) - The
DockerfilemustEXPOSEthe port your app listens on, and your app must bind to0.0.0.0, not127.0.0.1— a container that only listens on localhost is unreachable from outside itself - Read the port from the
PORTenvironment 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.ymlfor local development — DockHosting only builds the singleDockerfileyou 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
.dockerignoreand got excluded — check that file for an overly broad pattern like*.jsonornode_modulesthat'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.