Giter Site home page Giter Site logo

devcontainer's Introduction

A Sample Dev Container

This will work with GitHub codespaces (either in browser or via your local VSCode - requires a VSCode extension).

This uses the sample Python devcontainer as inspiration. Lots more sample environments here.

Also interesting (but untested) is https://github.com/loft-sh/devpod which promises to read this file but spin up on local machines / any cloud.

Don't forget to delete your codespace after use, see below!

Usage

To launch a new codespace, click the Code button, change to the Codespaces tab and click Create codespace on main.

The random, two word name for the codespace will be generated. In this case "probable winner".

The codespace will begin creation in a new browser window. Wait until the codespace is running.

You should see this command in the terminal. Leave it running.

Toggle over to the Ports tab and right click the row for port 8080.

Choose Open in browser

The demo application should be displayed.

Explanation

The codespace template is found in .devcontainer/devcontainer.json.

In this example, a custom container is built from the Dockerfile (but you can also reference an existing image).

After the container is built and running, the postStartCommand (see .devcontainer/devcontainer.json) is used to run a flask web application server automatically for you.

The forwardPorts directive in .devcontainer/devcontainer.json is used to privately (only to your GitHub user) expose port 8080 and make the application available.

Codespace teardown

Go to https://github.com/codespaces and delete your codespace to avoid unneccessary charges!

Links

devcontainer's People

Contributors

agardnerit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.