Skip to content

joeriddles/devcontainer-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo demonstrates how to setup a VS Code devcontainer using multiple docker-compose files.

.env file must be in the same directory as the docker-compose files. See this issue for more info. In this repo, we have duplicated .env from the base directory to also the subdirectory /docker.

docker-compose Services

code is the container that VS Code will attach to. We mount our source code into the container.

app is the example Python application. This service would typically be an API or other application that is built using your source code. In this case, the image expects a single build argument, HELLO_WORLD, and prints this argument to stdout using the Python app. The environment variable is automatically picked-up from .env by docker.

other_app exists only to showcase that we can override an image's default command from our compose file. We can use environment variable subsitution in the service's command.

Both app and other_app should print the environment variable value of HELLO_WORLD to stdout and exit without any errors.