> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slipway.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Language runtimes

> Build a repository that has no Dockerfile by picking a language runtime.

A language runtime builds your repository without a Dockerfile. You pick the language and
version, slipway generates the build, installs dependencies from your lockfile, and starts
the service.

A repository that has a Dockerfile is unaffected. A runtime applies only when you select
one instead.

## Available runtimes

| Runtime | `runtime:` | Versions | Default | Default start |
| - | - | - | - | - |
| Node | `node` | 18, 20, 22 | 22 | `npm start` |
| Python | `python` | 3.11, 3.12 | 3.12 | `python main.py` |
| Go | `go` | 1.23, 1.24 | 1.24 | the compiled binary |
| Ruby | `ruby` | 3.3, 3.4 | 3.4 | `bundle exec ruby main.rb` |
| Rust | `rust` | 1 | 1 | the compiled binary |
| Elixir | `elixir` | 1.17, 1.18 | 1.18 | `mix run --no-halt` |

`runtime: docker` means the opposite of these: build the Dockerfile committed in the
repository.

## Selecting a runtime

**Console**

When you deploy a repository that has no `slipway.yaml`, no `docker-compose.yml` and
no Dockerfile, slipway looks for a language marker and preselects the matching
runtime.

| Marker | Runtime |
| - | - |
| `package.json` | Node |
| `requirements.txt`, `pyproject.toml` | Python |
| `go.mod` | Go |
| `Gemfile` | Ruby |
| `Cargo.toml` | Rust |
| `mix.exs` | Elixir |

Confirm the runtime and version, optionally set a build command and a start command,
then deploy.

**slipway.yaml**

```yaml slipway.yaml theme={"system"}
version: 1

services:
  - name: api
    runtime: node
    runtimeVersion: "22"
    buildCommand: npm run build
    command: ["npm", "start"]
    ports:
      - port: 3000
        public: true
```

`buildCommand` runs at build time, after dependencies are installed. It is not the
start command. `command` is what the container runs.

`runtimeVersion` requires `runtime`. Setting it without one fails validation.

If you omit `runtimeVersion`, slipway uses the default in the table above. When a default
moves up, your next deploy builds on the new version. Pin the version to opt out of that.

`runtime` cannot be combined with `dockerfilePath` or `dockerTarget`. A runtime generates
its own Dockerfile, so there is nothing for those fields to point at.

## Rebuilds

A runtime build is reused unless the commit, the runtime, the version or the build command
changes.

## Compiled runtimes

Go and Rust build in a separate stage and ship a small runtime image.

If you set a custom `buildCommand` for them, it owns that stage and must place the output
where the runtime image expects it:

| Runtime | Output location |
| - | - |
| Go | the binary at `/out/app` |
| Rust | binaries under `/out/bin` |

The default build commands already do this.

## When to commit a Dockerfile instead

Use a Dockerfile when you need system packages, a private build step, a process manager,
or a base image the runtimes do not offer.

A Dockerfile can take over from a runtime at any time. Change the service's source in the
[Blueprint editor](/projects/blueprints), or set `runtime: docker` in the spec.

## FAQ

**Can different services in one project use different runtimes?**

**Yes.** A runtime is set per service. A Node frontend and a Go API can sit in the same
project, from the same repository or different ones.

**Does a runtime service get a build cache?**

**Yes.** Dependency installation is cached the same way a Dockerfile build is.

**Does the build see my environment variables?**

**Yes.** Every value in the service's `env` is available to the dependency install and the
build command, so a framework that inlines values at build time, such as Next.js with
`NEXT_PUBLIC_*`, picks them up. Changing a value and redeploying rebuilds those steps. See
[how values reach the build](/slipway-yaml/secrets-and-variables#how-values-reach-your-container).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.