# Docker

Source : https://webgune.cloud/en-us/docs/docker · Mis à jour le 2026-10-27

# Docker

If your repository contains a `Dockerfile`, Webgune can use it to build the image. Pick the **Dockerfile** mode when creating the service or in its settings: the auto builder then steps aside and your Dockerfile takes precedence. In auto build, it is only used when no framework or language is recognized.

## Detection

```text
my-project/
├── Dockerfile        ← used in Dockerfile mode
├── .dockerignore
└── src/
```

## The port, once again

Whether in your Dockerfile's `CMD` or in your application code, the listening port must follow the `PORT` variable provided by Webgune:

```dockerfile
CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port $PORT"]
```

## .dockerignore

Systematically exclude anything that bloats the build context without being useful to the final image:

```text
node_modules
.git
.env
dist
*.log
```

For Dockerfile writing best practices (multi-stage, image size), see [Writing a Dockerfile](/docs/docker-dockerfile). To deploy an already published image without having a repository to build, see [Public Docker images](/docs/docker-images).
