# Deploy a Dockerfile on Light Cloud

> A Dockerfile describes the whole image, so any language, binary or system package runs. Light Cloud detects it from a Dockerfile at the root of the repository (subfolders are not searched). It runs as a container that scales with traffic and down to zero when idle.

## Docker at a glance

- **Detected from:** a `Dockerfile` at the root of the repository (subfolders are not searched)
- **Runs as:** Container that scales with traffic and to zero when idle
- **Build:** Your Dockerfile, as is
- **Port:** The last `EXPOSE` line, otherwise 8080
- **Good to know:** A Dockerfile at the root always wins over framework detection.

## How to deploy Docker

1. **Bring the code.** Pick a repository, upload a folder, or ask Claude Code or GitHub Copilot to put it online.
2. **Docker, detected.** The files are read and the build is filled in. Every setting can be changed by hand.
3. **Built into a container.** An image is built and started, listening on the port the app expects.
4. **Live.** A light-cloud.io URL in minutes, a preview URL for every branch, and logs and metrics beside it.

## Add a database

- [PostgreSQL](https://light-cloud.com/databases/postgresql): Shared or dedicated

## Questions

### How do I deploy Docker?

Connect the repository, upload the folder, or ask Claude Code or GitHub Copilot to deploy it. Light Cloud reads the files, builds Docker and returns a live URL in minutes, with a preview URL for every branch.

### How much does it cost to host Docker?

The Free plan runs up to 3 server apps with $1 of usage a month and no card. A container is billed by the hour only while it runs, so an idle app costs nothing and a quiet one uses about $0.10 a month. Paid plans start at $5 a month with $5 of usage included.

### Can a Docker app use a database?

Yes. Create a PostgreSQL database in the same project and set its connection string as DATABASE_URL. Databases come with paid plans, from $5 a month.

Docs: https://docs.light-cloud.com/platform/frameworks/docker
Page: https://light-cloud.com/runtimes/docker
Deploy a Dockerfile: https://console.light-cloud.com/new?repo=https://github.com/light-cloud-templates/dockerfile-starter
Start free, no card: https://console.light-cloud.com/signup
