Docker is a software platform that allows you to build, test, and deploy applications quickly.
Docker packages software into standardized units called containers that have everything
the software needs to run including libraries, system tools, code, and runtime.
├── app
│ ├── __init__.py
│ └── app.py
├── .gitignore
├── Dockerfile
├── README.md
├── main.py
└── requirements.txt
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000
Hello "FastApi in Docker test"
item_id 5
q "somequery"
Maybe run as sudo
docker build -t fastdoc .
docker run -d --name fastdoc -p 80:80 fastdoc
docker container stop fastdoc
fastdoc
docker container sart fastdoc
fastdoc
Hello "FastApi in Docker test"
item_id 5
q "somequery"
- View image:
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
fastdoc latest 177ca8c9a42c 6 seconds ago 868MB
- View container:
docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS
02aada22a754 fastdoc "uvicorn app.app:app…" 20 seconds ago Up 19 seconds
- Remove container:
docker container rm fastdoc
fastsoc
- Remove image:
docker image rm fastdoc
Untagged: fastdoc:latest
Deleted: sha256:177ca8c9