Skip to content

chrismear/prebuilt-codespace-with-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of prebuilt Codespace using Docker Compose

This is a minimal example showing one way to set up GitHub Codespaces for a web app project that uses a custom Dockerfile and a Docker Compose configuration.

Setup

In the Dev Container configuration, key things to note are:

  • Specifying a path to the docker-compose.yml file relative to the .devcontainer directory:
  "dockerComposeFile": "../docker-compose.yml",
  "service": "dev",
  "workspaceFolder": "/app",
  • Specifying a port to forward:
  "forwardPorts": [5000],
"features": {
  "ghcr.io/devcontainers/features/docker-outside-of-docker": {}
}

Developer experience

When a developer opens this repository in a Codespace:

  1. All the services specified in the Docker Compose config will be started up (using a prebuilt Codespace snapshot if available).
  2. VS Code will connect to the dev service.
  3. The forwarded port will automatically appear in the Ports view in VS Code.

About

Minimal example of a prebuilt Codespace that uses Docker Compose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published