# Using Doppler + vscode + dev container + docker-compose

**URL:** <https://community.doppler.com/t/using-doppler-vscode-dev-container-docker-compose/352>\
**Category:** Need Help\
**Created:** [September 29, 2021, 3:35pm UTC](https://community.doppler.com/t/using-doppler-vscode-dev-container-docker-compose/352 "2021-09-29T15:35:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugene](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/eugene/32/238_2.png) [@eugene](https://community.doppler.com/u/eugene)\
**Post date:** [September 29, 2021, 3:35pm UTC](https://community.doppler.com/t/using-doppler-vscode-dev-container-docker-compose/352/1 "2021-09-29T15:35:37Z")

</div>

Hi! I have trouble setting up these things. I have a project with .devcontainer. Remote container is build from docker-compose.yml (something like this - [example](https://github.com/0916dhkim/vscode-devcontainer-tutorial/tree/master/.devcontainer)). I found this video - [How To Use Visual Studio Dev Containers To Develop Node.js Apps Remotely on AWS](https://www.youtube.com/watch?v=_h9dz6drUNw) but in this tutorial they use plain Dockerfile. I need to run additional services in docker-compose.yml, and configure them using env variables from doppler while building vscode dev container. How do I achieve this? Thanks!

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [September 29, 2021, 11:14pm UTC](https://community.doppler.com/t/using-doppler-vscode-dev-container-docker-compose/352/2 "2021-09-29T23:14:54Z")

</div>

Hey Eugene and welcome to the Doppler community!

We don’t yet have a dev container example using Docker Compose but before getting to that, are you using the Doppler CLI with Docker Compose locally to run your application?

> **[Docker Compose](https://docs.doppler.com/docs/enclave-docker-compose#local-development)**
>
> reading time 5 mins

If so, all you should theoretically need to do is populate the required `DOPPLER_TOKEN` environment variable in the VS Code process that will be spawning `docker-compose` and your dev container.

That can then be made available to your dev container by configuring the `containerEnv` property in your `devcontainer.json` file to pull `DOPPLER_TOKEN` from the VS Code process:

```json
"containerEnv": {
    "DOPPLER_PROJECT": "your-project",
    "DOPPLER_CONFIG": "dev",
    "DOPPLER_TOKEN": "${localEnv:DOPPLER_TOKEN}", 
}

```

The easiest method of populating the `DOPPLER_TOKEN` environment variable is by [launching your dev container using the devcontainer CLI](https://code.visualstudio.com/docs/remote/devcontainer-cli):

```auto
DOPPLER_TOKEN="$(doppler configure get token --plain)" devcontainer open ~/Projects/your-applcation

```

Let me know how you go!

---

<div class="post-metadata">

**Author:** ![eugene](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/eugene/32/238_2.png) [@eugene](https://community.doppler.com/u/eugene)\
**Post date:** [September 30, 2021, 6:30am UTC](https://community.doppler.com/t/using-doppler-vscode-dev-container-docker-compose/352/3 "2021-09-30T06:30:07Z")

</div>

Thanks for your answer, Ryan. I achieved my goal with devcontainer CLI:

```auto
doppler run -- devcontainer open ~/source/my-folder

```

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [October 1, 2021, 2:36am UTC](https://community.doppler.com/t/using-doppler-vscode-dev-container-docker-compose/352/4 "2021-10-01T02:36:38Z")

</div>

Excellent @eugene!

Love it when a plan comes together!
