﻿# Render

> Use dotenvx with Render

Find [code examples for this guide](https://github.com/dotenvx/examples/tree/main/platforms/docker) on GitHub.

Deploying to [Render](https://render.com) takes more steps than we document here. Follow their [Docker guide](https://docs.render.com/docker#docker-builds-on-render) (Render recognizes your `Dockerfile` automatically). This guide shows the dotenvx pieces in a Docker context.

## Dockerfile

```text
# .dockerignore
.env.keys
```

```docker
# Dockerfile
FROM node:20
WORKDIR /app

RUN curl -sfS https://dotenvx.sh | sh

COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000

CMD ["dotenvx", "run", "--", "node", "index.js"]
```

For custom builds and installation options, see [dotenvx install](/docs/cli/install/).

## Encrypt production

```dotenv
# .env.production
HELLO="production"
```

```console
$ dotenvx encrypt -f .env.production
```

Commit `.env.production`. Do not commit `.env.keys`.

## Set decryption key

Set `DOTENV_PRIVATE_KEY_PRODUCTION` to your production private key and `DOTENV_FILE` to `.env.production` in Render's environment variable manager, then redeploy. Your app injects env from the encrypted `.env.production` file.
