Skip to content

Latest commit

 

History

History
97 lines (74 loc) · 3.75 KB

README.md

File metadata and controls

97 lines (74 loc) · 3.75 KB

Dev Container Presentation / Demo

🚨 This project is used for giving dev container presentations/demos. It is not meant to show "good" or production ready code. The purpose is to show how a fully configured development environment can be spun up in isolation from the host machine in minutes.

🚚 What is a dev container?

Dev Containers are a feature currently shipping for Visual Studio Code (as an extension) utilizing containers to create fully configured and version controlled development environments.

✅ Great what does that give me?

  • Team members are always working from the same:
    • Base Operating System
    • Network Stack
    • Required Extensions and Configuration
    • CLI Tools
  • Host OS agnostic.
  • Full project setup in minutes.
  • Version controlled Development experience.
  • Can be hosted in the cloud (Example: GitHub Codespaces).
  • ⭐️ NEW: Multiple Configurations Per Project allowing for different setups for different types of work.

👎 Downsides

  • Slower than running on the Host OS.
  • Currently a Visual Studio Code and GitHub Codespaces only feature.
  • Flakey containers if running on arch64 (Example: Apple Silicon).
    • Software is still transitioning.
    • This is more of a Docker issue than a dev container issue.
    • 🚨 I picked this stack for this project as it currently is one of those flakey containers and I want to show what to do when things go wrong.

🛠️ Requirements

💬 Presenter Notes

🛠️ Pre-Presentation Setup

  • Be sure above software is downloaded and configured.
  • Delete any containers, images, and volumes associated with this repo prior to presentation.

🧐 Things To Show

☝️ This Project

  • Starting out, no images, container, or volumes exist for this project.
  • Cloning this project with Dev Container.
    • Show .devcontainer directory.
  • "Open in Container" icon and prompt.
  • Startup Log
  • Terminal (In Container vs Host OS)
  • Configuration
    • .devcontainer.json
    • Dockerfile
  • Extensions:
    • SQL (Configured)
      • Show Postgres connection, but no db.
    • Adding new extensions to .devcontainer.json via extension panel.
      • Search for vscode-pets.
  • Migrations
    • Run via Terminal
      • cd backend
      • sqlx migrate run
    • Show in Extension
  • Mapped Ports
    • Start project:
      • cd backend
      • cargo build
      • cargo run
        • 🚨 I know cargo run does a build, but this is working around one of the flakey issues in this container.

    • Show access via host:
      • http://localhost:3000
      • 🚨 Notice database connectivity.

        • Data will persist via container volume, even if container is destroyed.

🎉 Creating a New Project

  • Show how to make a node.js dev container.
  • Use newer version than local.
    • Show differences in terminal.
  • Example code:
console.log("Hello, Dev Container");

🎨 Show Production Level Project

  • Quick Overview of Project
  • Mapped Environment Variables