Skip to content

Dev Container from scratch demo, Python FastAPI use vim as editor

Notifications You must be signed in to change notification settings

mrchoke/devcontainer-from-scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevContainer From Scratch

Dev in Container

Requirement for this project

  • docker
  • docker-compose

Install Devcontainer CLI

npm install -g @devcontainers/cli

Clone

git clone https://github.com/mrchoke/devcontainer-from-scratch.git

Run

cd devcontainer-from-scratch
devcontainer up --workspace-folder ./
devcontainer exec --workspace-folder ./ fish

Up DevContainer

Dev

vim main.py

main.py

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def  root():
    return { "I ♥️ ": "You" }

Run Code

uvicorn main:app --host=0.0.0.0

Open API

curl http://localhost:8000

Or open with web browser

Open From Host

Install packages

sudo apt update
sudo apt install xyz
sudo pip install god

Down and Destroy

docker ps
docker stop your-devcontainer
docker rm your-devcontainer

Ref

https://github.com/devcontainers/cli

About

Dev Container from scratch demo, Python FastAPI use vim as editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published